From e0d1655c1f4e38e3b04f692040f68c67e109866f Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 28 Aug 2024 17:03:39 +0200 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ lib/threads.in.h | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1dce1c2494..4870909dff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-08-28 Bruno Haible + + 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 mcel: Fix compilation error with MSVC. diff --git a/lib/threads.in.h b/lib/threads.in.h index 06bc9b78df..b4f5b65c63 100644 --- a/lib/threads.in.h +++ b/lib/threads.in.h @@ -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. */ -- 2.39.5