]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Use __declspec( thread ) for thread local storage when compiling with Visual Studio...
authorOndřej Surý <ondrej@sury.org>
Sat, 25 Aug 2018 11:29:27 +0000 (13:29 +0200)
committerOndřej Surý <ondrej@sury.org>
Sat, 25 Aug 2018 11:59:26 +0000 (13:59 +0200)
lib/isc/random.c
lib/isc/win32/include/isc/platform.h.in
lib/isc/xoshiro128starstar.c

index 9cf635a37f117795fdfc13bed2a9f011ccc78810..3f49cb512f706169f02606a364a3c22b66fa6b36 100644 (file)
@@ -67,6 +67,8 @@
 static thread_local isc_once_t isc_random_once = ISC_ONCE_INIT;
 #elif defined(HAVE___THREAD)
 static __thread isc_once_t isc_random_once = ISC_ONCE_INIT;
+#elif defined(HAVE___DECLSPEC_THREAD)
+static __declspec( thread ) isc_once_t isc_random_once = ISC_ONCE_INIT;
 #else
 #error "Unknown method for defining a TLS variable!"
 #endif
index 7f2bdbfb6b27cf9b9c20f8d6bb97e76582d26306..691ac001226ff2fe3b9d4b9ceb78ee0db798da40 100644 (file)
  ***** Platform-dependent defines.
  *****/
 
+#if _MSC_VER > 1400
+#define HAVE_TLS 1
+#define HAVE___DECLSPEC_THREAD 1
+#endif
+
 /*
  * Some compatibility cludges
  */
index bc08e6740f2e08b66b28db65002fde1f9ff04057..fb71a244190694081bedb210cda10cdccff720a3 100644 (file)
@@ -42,6 +42,8 @@
 static thread_local uint32_t seed[4];
 #elif defined(HAVE___THREAD)
 static __thread uint32_t seed[4];
+#elif defined(HAVE___DECLSPEC_THREAD)
+static __declspec( thread ) uint32_t seed[4];
 #else
 #error "Unknown method for defining a TLS variable!"
 #endif