diff options
author | Siva Chandra Reddy <sivachandra@google.com> | 2023-05-25 19:29:19 +0000 |
---|---|---|
committer | Siva Chandra Reddy <sivachandra@google.com> | 2023-05-25 19:53:52 +0000 |
commit | daeee56798c51e8f007e8e8e6e677a420b14c9ef (patch) | |
tree | 274706ee7eb2ca0f19a8b1e5a6f7651bbb0b9491 /libc/src/stdlib/rand_util.cpp | |
parent | df1b2bef0c7cad11681a02e9e2f816b27fb480a6 (diff) | |
download | llvm-daeee56798c51e8f007e8e8e6e677a420b14c9ef.zip llvm-daeee56798c51e8f007e8e8e6e677a420b14c9ef.tar.gz llvm-daeee56798c51e8f007e8e8e6e677a420b14c9ef.tar.bz2 |
[libc] Add macro LIBC_THREAD_LOCAL.
It resolves to thread_local on all platform except for the GPUs on which
it resolves to nothing. The use of thread_local in the source code has been
replaced with the new macro.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D151486
Diffstat (limited to 'libc/src/stdlib/rand_util.cpp')
-rw-r--r-- | libc/src/stdlib/rand_util.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libc/src/stdlib/rand_util.cpp b/libc/src/stdlib/rand_util.cpp index afa6662..9c29eb8 100644 --- a/libc/src/stdlib/rand_util.cpp +++ b/libc/src/stdlib/rand_util.cpp @@ -7,9 +7,10 @@ //===----------------------------------------------------------------------===// #include "src/stdlib/rand_util.h" +#include "src/__support/macros/attributes.h" namespace __llvm_libc { -thread_local unsigned long rand_next; +LIBC_THREAD_LOCAL unsigned long rand_next; } // namespace __llvm_libc |