From: Francis Ma Date: Thu, 28 Jan 2016 00:33:36 +0000 (-0800) Subject: Fix FOLLY_TLS under macosx and clang X-Git-Tag: deprecate-dynamic-initializer~131 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=eeb13d00be50f10535ce2868a80ba5a20dbcbee0;p=folly.git 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 --- 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)