diff --git a/src/LinearMath/btQuickprof.cpp b/src/LinearMath/btQuickprof.cpp index d06ddaf54..d2b970152 100644 --- a/src/LinearMath/btQuickprof.cpp +++ b/src/LinearMath/btQuickprof.cpp @@ -708,7 +708,8 @@ unsigned int btQuickprofGetCurrentThreadIndex2() { #if BT_THREADSAFE return btGetCurrentThreadIndex(); -#elif defined(BT_HAVE_TLS) +#else +#if defined(BT_HAVE_TLS) static __thread unsigned int sThreadIndex = kNullIndex; #elif defined(_WIN32) __declspec(thread) static unsigned int sThreadIndex = kNullIndex; @@ -723,6 +724,7 @@ unsigned int btQuickprofGetCurrentThreadIndex2() { sThreadIndex = gThreadCounter++; } return sThreadIndex; +#endif //BT_THREADSAFE } void btEnterProfileZoneDefault(const char* name)