[PATCH] D56905: [libunwind] [SjLj] Don't use __declspec(thread) in MinGW mode

Martin Storsjö via Phabricator reviews at reviews.llvm.org
Fri Jan 18 05:27:02 PST 2019


mstorsjo created this revision.
mstorsjo added reviewers: mclow.lists, EricWF, ldionne, compnerd, smeenai, rnk.
Herald added a subscriber: libcxx-commits.
mstorsjo edited the summary of this revision.

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).


Repository:
  rUNW libunwind

https://reviews.llvm.org/D56905

Files:
  src/Unwind-sjlj.c


Index: src/Unwind-sjlj.c
===================================================================
--- src/Unwind-sjlj.c
+++ src/Unwind-sjlj.c
@@ -52,7 +52,7 @@
 #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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56905.182501.patch
Type: text/x-patch
Size: 441 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190118/0da350f2/attachment.bin>


More information about the libcxx-commits mailing list