From 9298471e12416e2c65a4c471493c2367e1637176 Mon Sep 17 00:00:00 2001 From: Gregor Jasny Date: Fri, 19 Feb 2016 10:11:04 +0100 Subject: [PATCH] Disable thread local storage for OSX < 10.7 --- src/google/protobuf/stubs/platform_macros.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/google/protobuf/stubs/platform_macros.h b/src/google/protobuf/stubs/platform_macros.h index 22b35723e..980c54b20 100644 --- a/src/google/protobuf/stubs/platform_macros.h +++ b/src/google/protobuf/stubs/platform_macros.h @@ -93,6 +93,7 @@ GOOGLE_PROTOBUF_PLATFORM_ERROR #if defined(__APPLE__) #define GOOGLE_PROTOBUF_OS_APPLE +#include #include #if TARGET_OS_IPHONE #define GOOGLE_PROTOBUF_OS_IPHONE @@ -119,4 +120,9 @@ GOOGLE_PROTOBUF_PLATFORM_ERROR #define GOOGLE_PROTOBUF_NO_THREADLOCAL #endif +#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 1070 +// __thread keyword requires at least 10.7 +#define GOOGLE_PROTOBUF_NO_THREADLOCAL +#endif + #endif // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_