Skip to content

Commit 2037f06

Browse files
committed
Modify attributes.h to use new LIBC_THREAD_MODE
1 parent 1254b65 commit 2037f06

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libc/src/__support/macros/attributes.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
#define LIBC_INLINE_ASM __asm__ __volatile__
2929
#define LIBC_UNUSED __attribute__((unused))
3030

31-
#ifdef LIBC_TARGET_ARCH_IS_GPU
31+
// LIBC_THREAD_MODE is undefined when building libcxx. However, it is ok to just
32+
// use thread_local in a C++ context
33+
#if defined(LIBC_THREAD_MODE) && LIBC_THREAD_MODE == LIBC_THREAD_MODE_SINGLE
3234
#define LIBC_THREAD_LOCAL
3335
#else
3436
#define LIBC_THREAD_LOCAL thread_local

0 commit comments

Comments
 (0)