aboutsummaryrefslogtreecommitdiffhomepage
path: root/absl/base/config.h
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2018-04-09 08:30:09 -0700
committerGravatar Matt Calabrese <calabrese@x.team>2018-04-09 12:39:17 -0400
commit3f622d6c5990a7ae80eb8e52450c309a28bbec77 (patch)
tree70000b088551993876c1fd5bbf619f022bd1dc66 /absl/base/config.h
parentabd0824ba64094e860803730c44d985334ad8770 (diff)
- 51e2d3690b9065da84dbbf71fb52f87149670719 Fix `ABSL_HAVE_THREAD_LOCAL` on Apple 32-bit iOS simulato... by Xiaoyi Zhang <zhangxy@google.com>
- d38332e4d6b51542a42ff49fb0fc4f4a756fdd05 Internal change. by Abseil Team <absl-team@google.com> GitOrigin-RevId: 51e2d3690b9065da84dbbf71fb52f87149670719 Change-Id: I9403fc6308a6c731f1c8e2cd70fdb382fafd960e
Diffstat (limited to 'absl/base/config.h')
-rw-r--r--absl/base/config.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/absl/base/config.h b/absl/base/config.h
index 87e403a..500bc8c 100644
--- a/absl/base/config.h
+++ b/absl/base/config.h
@@ -138,12 +138,16 @@
// supported.
#ifdef ABSL_HAVE_THREAD_LOCAL
#error ABSL_HAVE_THREAD_LOCAL cannot be directly set
-#elif (!defined(__apple_build_version__) || \
- (__apple_build_version__ >= 8000042)) && \
- !(defined(__APPLE__) && TARGET_OS_IPHONE && \
- __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0)
+#elif defined(__APPLE__)
// Notes: Xcode's clang did not support `thread_local` until version
-// 8, and even then not for all iOS < 9.0.
+// 8, and even then not for all iOS < 9.0. Also, Xcode 9.3 started disallowing
+// `thread_local` for 32-bit iOS simulator targeting iOS 9.x.
+// `__has_feature` is only supported by Clang so it has be inside
+// `defined(__APPLE__)` check.
+#if __has_feature(cxx_thread_local)
+#define ABSL_HAVE_THREAD_LOCAL 1
+#endif
+#else // !defined(__APPLE__)
#define ABSL_HAVE_THREAD_LOCAL 1
#endif