aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Nicolas Noble <nicolasnoble@users.noreply.github.com>2016-09-08 19:58:38 -0700
committerGravatar GitHub <noreply@github.com>2016-09-08 19:58:38 -0700
commit1b5f057995fb2b53746db281ae519d9ae475d24c (patch)
tree723f6ae35b95ba156580e972f719fa95b5504b1a
parent7f936eaa379e88869fcdb187d084f9bd7300c792 (diff)
parent72838d6414541e85aec7b2973902f8e3998bc74b (diff)
Merge pull request #7196 from soltanmm/old-mac-donald-had-a-farm
Enable Mac OS X 10.6 compilation
-rw-r--r--include/grpc/impl/codegen/port_platform.h11
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 7c67bad5ae..f97e386289 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