]> 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>
Tue, 17 Sep 2024 11:04:23 +0000 (13:04 +0200)
* lib/threads.in.h (thread_local): Don't define as a macro in C++ 11
or newer.

ChangeLog
lib/threads.in.h

index ffeb7aa891ab7eb86aadb6f571161dc5a758d86e..c17f003e3151d00c51775939542075aef2d5a9d8 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-27  Bruno Haible  <bruno@clisp.org>
 
        mcel: Fix compilation error with MSVC.
index 06bc9b78df30bf4e4bf74be625b5202292e7d450..b4f5b65c63d147f72cf979d2835a22f8e3509346 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.  */