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 793961 0f978b1743850ebab912dcd1594fc2cb036868ee
parent 793838 01fe55fec9f89322ee2369cf5487780367585b24
child 793962 81b2a2487123ea6689cb339528748ec477d87714
push id109541
push userbmo:tom@mozilla.com
push dateFri, 11 May 2018 03:11:36 +0000
reviewersfroydnj
bugs1460645
milestone60.0
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