From db2d14b917d3624efd3c8a2402eee4de3b65704f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 3 Feb 2021 12:13:05 -0800 Subject: [PATCH] Enable thread_local on newer Xcode versions P4:6348456 --- .../clientlib/steamnetworkingsockets_lowlevel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_lowlevel.cpp b/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_lowlevel.cpp index 22a4651..5188721 100644 --- a/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_lowlevel.cpp +++ b/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_lowlevel.cpp @@ -90,7 +90,9 @@ static ThreadLockDebugInfo &GetThreadDebugInfo() // Apple seems to hate thread_local. Is there some sort of feature // define a can check here? It's a shame because it's really very // efficient on MSVC, gcc, and clang on Windows and linux. - #ifdef __APPLE__ + // + // Apple seems to support thread_local starting with Xcode 8.0 + #if defined(__APPLE__) && __clang_major__ < 8 static pthread_key_t key; static pthread_once_t key_once = PTHREAD_ONCE_INIT;