diff options
author | Masood Malekghassemi <atash@google.com> | 2016-07-01 08:53:33 -0700 |
---|---|---|
committer | Masood Malekghassemi <atash@google.com> | 2016-07-01 08:54:41 -0700 |
commit | 72838d6414541e85aec7b2973902f8e3998bc74b (patch) | |
tree | ad113d312b069c1330b54508682058c813ccaecb | |
parent | 20caeb182cbc152e7e038306a9b01f438f79ca41 (diff) |
Enable Mac OS X 10.6 compilation
Mac OS X 10.6 is an important Python target, and doesn't support `__thread`.
-rw-r--r-- | include/grpc/impl/codegen/port_platform.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h index 3ad665a7a2..fb7f4248b9 100644 --- a/include/grpc/impl/codegen/port_platform.h +++ b/include/grpc/impl/codegen/port_platform.h @@ -234,6 +234,7 @@ #define GPR_ARCH_32 1 #endif /* _LP64 */ #elif defined(__APPLE__) +#include <Availability.h> #include <TargetConditionals.h> #ifndef _BSD_SOURCE #define _BSD_SOURCE @@ -246,8 +247,18 @@ #define GPR_PTHREAD_TLS 1 #else /* TARGET_OS_IPHONE */ #define GPR_PLATFORM_STRING "osx" +#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED +#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_7 +#define GPR_CPU_IPHONE 1 +#define GPR_PTHREAD_TLS 1 +#else /* __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_7 */ +#define GPR_CPU_POSIX 1 +#define GPR_GCC_TLS 1 +#endif +#else /* __MAC_OS_X_VERSION_MIN_REQUIRED */ #define GPR_CPU_POSIX 1 #define GPR_GCC_TLS 1 +#endif #define GPR_POSIX_CRASH_HANDLER 1 #endif #define GPR_GCC_ATOMIC 1 |