From 2f58cf0d0053b8f2f81b137198d788ccdac2b1c7 Mon Sep 17 00:00:00 2001 From: kwasimensah Date: Sun, 12 Nov 2017 00:48:59 -0500 Subject: [PATCH] Fix MACROS for when BT_THREADSAFE is defined --- src/LinearMath/btQuickprof.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)