Bug 1460645 Avoid the thread_local keyword for MinGW and instead use __thread r?froydnj draft
authorTom Ritter <tom@mozilla.com>
Thu, 10 May 2018 11:11:19 -0500
changeset 795903 624a437e873422b36e40059f2d0d99262841417c
parent 795902 7cc103c81c645a1d0290f7bd193e30733efd23b6
child 795904 532ef470389002a67f4adfc47bbf356d19caaf9e
push id110108
push userbmo:tom@mozilla.com
push dateWed, 16 May 2018 18:43:56 +0000
reviewersfroydnj
bugs1460645
milestone60.0.1
Bug 1460645 Avoid the thread_local keyword for MinGW and instead use __thread r?froydnj MozReview-Commit-ID: 5RPwQVatThs
mfbt/ThreadLocal.h
--- a/mfbt/ThreadLocal.h
+++ b/mfbt/ThreadLocal.h
@@ -232,17 +232,17 @@ ThreadLocal<T, Storage>::set(const T aVa
 {
   MOZ_ASSERT(Storage<T>::initialized());
   bool succeeded = Storage<T>::set(aValue);
   if (!succeeded) {
     MOZ_CRASH();
   }
 }
 
-#if defined(XP_WIN) || defined(MACOSX_HAS_THREAD_LOCAL)
+#if (defined(XP_WIN) || defined(MACOSX_HAS_THREAD_LOCAL)) && !defined(__MINGW32__)
 #define MOZ_THREAD_LOCAL(TYPE) thread_local mozilla::detail::ThreadLocal<TYPE, mozilla::detail::ThreadLocalNativeStorage>
 #elif defined(HAVE_THREAD_TLS_KEYWORD)
 #define MOZ_THREAD_LOCAL(TYPE) __thread mozilla::detail::ThreadLocal<TYPE, mozilla::detail::ThreadLocalNativeStorage>
 #else
 #define MOZ_THREAD_LOCAL(TYPE) mozilla::detail::ThreadLocal<TYPE, mozilla::detail::ThreadLocalKeyStorage>
 #endif
 
 } // namespace detail