]> Savannah Git Hosting - gnulib.git/commitdiff
threads-h: Don't override the C++ keyword 'thread_local'.
authorBruno Haible <bruno@clisp.org>
Wed, 28 Aug 2024 15:03:39 +0000 (17:03 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 28 Aug 2024 15:11:19 +0000 (17:11 +0200)
* lib/threads.in.h (thread_local): Don't define as a macro in C++ 11
or newer.

ChangeLog
lib/threads.in.h

index 0d9bf439662faee73ae6a058823f8704fef347a0..a6e17128ad1362aea9d6e44b0cc136e383a38876 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-08-28  Bruno Haible  <bruno@clisp.org>
+
+       threads-h: Don't override the C++ keyword 'thread_local'.
+       * lib/threads.in.h (thread_local): Don't define as a macro in C++ 11
+       or newer.
+
 2024-08-28  Bruno Haible  <bruno@clisp.org>
 
        libgmp-mpz: New module, renamed from libgmp.
index 4e21fc7628dcd696dce9f34fd86e0a25d6c344fd..6a52e7b7957992433b662d57e390bc205040a649 100644 (file)
@@ -97,7 +97,9 @@
    its expansion ends in a semicolon.  */
 # undef thread_local
 #endif
-#if !@HAVE_THREADS_H@ || !defined thread_local
+#if (!@HAVE_THREADS_H@ || !defined thread_local) \
+    && !(defined __cplusplus \
+         && (__cplusplus >= 201103L || (defined _MSC_VER && _MSC_VER >= 1900)))
 # define thread_local _Thread_local
 #endif
 /* Define the macro thread_local if and only if it actually works.  */