From eeb13d00be50f10535ce2868a80ba5a20dbcbee0 Mon Sep 17 00:00:00 2001 From: Francis Ma Date: Wed, 27 Jan 2016 16:33:36 -0800 Subject: [PATCH] Fix FOLLY_TLS under macosx and clang Summary: Only include guard iphone simulator and iphone devices for folly_tls Reviewed By: ldemailly Differential Revision: D2872383 fb-gh-sync-id: 00fb8c1ee03a97037e92d20aeda75f2435d71f5a --- folly/Portability.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/folly/Portability.h b/folly/Portability.h index f4893a54..0e9c471b 100644 --- a/folly/Portability.h +++ b/folly/Portability.h @@ -223,9 +223,7 @@ namespace std { typedef ::max_align_t max_align_t; } * the semantics are the same * (but remember __thread has different semantics when using emutls (ex. apple)) */ -#if defined(__APPLE__) -#undef FOLLY_TLS -#elif defined(_MSC_VER) +#if defined(_MSC_VER) # define FOLLY_TLS __declspec(thread) #elif defined(__GNUC__) || defined(__clang__) # define FOLLY_TLS __thread @@ -233,6 +231,10 @@ namespace std { typedef ::max_align_t max_align_t; } # error cannot define platform specific thread local storage #endif +#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#undef FOLLY_TLS +#endif + // Define to 1 if you have the `preadv' and `pwritev' functions, respectively #if !defined(FOLLY_HAVE_PREADV) && !defined(FOLLY_HAVE_PWRITEV) # if defined(__GLIBC_PREREQ) -- 2.34.1