From 2a3c4408d2047e872e3c13f38027a801633da003 Mon Sep 17 00:00:00 2001 From: Kentucky Compass Date: Sat, 30 Dec 2017 20:14:07 -0800 Subject: [PATCH] Fix build on iOS (only iOS 9 and up support thread_local) --- ext/native/profiler/profiler.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/native/profiler/profiler.cpp b/ext/native/profiler/profiler.cpp index 35e270b477ed..811b78d7bf02 100644 --- a/ext/native/profiler/profiler.cpp +++ b/ext/native/profiler/profiler.cpp @@ -15,7 +15,12 @@ #define MAX_CATEGORIES 64 // Can be any number, represents max profiled names. #define MAX_DEPTH 16 // Can be any number, represents max nesting depth of profiled names. +#if PPSSPP_PLATFORM(IOS) && defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0 +// iOS did not support C++ thread_local before iOS 9 +#define MAX_THREADS 1 // Can be any number, represents concurrent threads calling the profiler. +#else #define MAX_THREADS 4 // Can be any number, represents concurrent threads calling the profiler. +#endif #define HISTORY_SIZE 128 // Must be power of 2 #ifndef _DEBUG