aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc/impl/codegen/port_platform.h
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2018-01-05 09:59:34 -0800
committerGravatar Vijay Pai <vpai@google.com>2018-01-05 09:59:34 -0800
commit91bab371297b1e53491548bbd9f3588dea93374d (patch)
treeeeba1cf8714177aa6a46c75513a099041bd29874 /include/grpc/impl/codegen/port_platform.h
parent2b0ab320c12cb807cf05b3295b7017d0ccbf66f5 (diff)
When building with bazel on a Mac, workaround bazelbuild/bazel#4341
Diffstat (limited to 'include/grpc/impl/codegen/port_platform.h')
-rw-r--r--include/grpc/impl/codegen/port_platform.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h
index f4bc3eb3e0..e6bee73ef1 100644
--- a/include/grpc/impl/codegen/port_platform.h
+++ b/include/grpc/impl/codegen/port_platform.h
@@ -195,12 +195,25 @@
#define GPR_PTHREAD_TLS 1
#else /* __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_7 */
#define GPR_CPU_POSIX 1
+/* TODO(vjpai): there is a reported issue in bazel build for Mac where __thread
+ in a header is currently not working (bazelbuild/bazel#4341). Remove
+ the following conditional and use GPR_GCC_TLS when that is fixed */
+#ifndef GRPC_BAZEL_BUILD
#define GPR_GCC_TLS 1
+#else /* GRPC_BAZEL_BUILD */
+#define GPR_PTHREAD_TLS 1
+#endif /* GRPC_BAZEL_BUILD */
#define GPR_APPLE_PTHREAD_NAME 1
#endif
#else /* __MAC_OS_X_VERSION_MIN_REQUIRED */
#define GPR_CPU_POSIX 1
+/* TODO(vjpai): Remove the following conditional and use only GPR_GCC_TLS
+ when bazelbuild/bazel#4341 is fixed */
+#ifndef GRPC_BAZEL_BUILD
#define GPR_GCC_TLS 1
+#else /* GRPC_BAZEL_BUILD */
+#define GPR_PTHREAD_TLS 1
+#endif /* GRPC_BAZEL_BUILD */
#endif
#define GPR_POSIX_CRASH_HANDLER 1
#endif