Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[MSVC] correct support for thread-local storage
[simgrid.git] / include / xbt / base.h
index 69e6900..54ab270 100644 (file)
 #   define XBT_ALWAYS_INLINE XBT_INLINE
 #endif
 
+#if defined(__GNUC__)
+#   define XBT_THREAD_LOCAL __thread
+#elif defined(_MSC_VER)
+#   define XBT_THREAD_LOCAL __declspec(thread)
+#else
+#   define XBT_THREAD_LOCAL No thread local on this architecture
+#endif
+
 /* improvable on gcc (by evaluating arguments only once), but wouldn't be portable */
 #ifdef MIN
 # undef MIN