[libunwind] r351587 - [SjLj] Don't use __declspec(thread) in MinGW mode

Martin Storsjo via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 18 12:31:12 PST 2019


Author: mstorsjo
Date: Fri Jan 18 12:31:12 2019
New Revision: 351587

URL: http://llvm.org/viewvc/llvm-project?rev=351587&view=rev
Log:
[SjLj] Don't use __declspec(thread) in MinGW mode

GCC and Clang in MinGW mode don't support __declspec(thread), which
after expanding macros ends up as __attribute__((thread)). Use the
GCC specific attribute __thread instead (the next one in the chain
of alternatives).

Differential Revision: https://reviews.llvm.org/D56905

Modified:
    libunwind/trunk/src/Unwind-sjlj.c

Modified: libunwind/trunk/src/Unwind-sjlj.c
URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/Unwind-sjlj.c?rev=351587&r1=351586&r2=351587&view=diff
==============================================================================
--- libunwind/trunk/src/Unwind-sjlj.c (original)
+++ libunwind/trunk/src/Unwind-sjlj.c Fri Jan 18 12:31:12 2019
@@ -52,7 +52,7 @@ struct _Unwind_FunctionContext {
 #else
 # if __STDC_VERSION__ >= 201112L
 #  define _LIBUNWIND_THREAD_LOCAL _Thread_local
-# elif defined(_WIN32)
+# elif defined(_MSC_VER)
 #  define _LIBUNWIND_THREAD_LOCAL __declspec(thread)
 # elif defined(__GNUC__) || defined(__clang__)
 #  define _LIBUNWIND_THREAD_LOCAL __thread




More information about the cfe-commits mailing list