diff --git a/src/libsodium/randombytes/internal/randombytes_internal_random.c b/src/libsodium/randombytes/internal/randombytes_internal_random.c index 5cee984f..cd9681c9 100644 --- a/src/libsodium/randombytes/internal/randombytes_internal_random.c +++ b/src/libsodium/randombytes/internal/randombytes_internal_random.c @@ -96,13 +96,13 @@ BOOLEAN NTAPI RtlGenRandom(PVOID RandomBuffer, ULONG RandomBufferLength); # endif #endif +#if !defined(TLS) && !defined(__STDC_NO_THREADS__) && \ + defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +# define TLS _Thread_local +#endif #ifndef TLS # ifdef _WIN32 -# if (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L) -# define TLS _Thread_local -# else -# define TLS __declspec(thread) -# endif +# define TLS __declspec(thread) # else # define TLS # endif