From 678596154f7c462d0f553f18b97e885a7b037c5f Mon Sep 17 00:00:00 2001 From: Michael Lee Date: Tue, 22 Mar 2016 11:45:43 -0700 Subject: [PATCH] Add APPLE to portability/Config Summary: And use that to guard the use of posix_memalign. Reviewed By: benyl Differential Revision: D3081743 fb-gh-sync-id: 2c71d9cbeeaeb59d1600d486cccfc2109699ba6b shipit-source-id: 2c71d9cbeeaeb59d1600d486cccfc2109699ba6b --- folly/portability/Config.h | 4 ++++ folly/portability/Memory.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/folly/portability/Config.h b/folly/portability/Config.h index eede9641..42119fcc 100755 --- a/folly/portability/Config.h +++ b/folly/portability/Config.h @@ -31,3 +31,7 @@ #ifdef __ANDROID__ #include #endif + +#ifdef __APPLE__ +#include +#endif diff --git a/folly/portability/Memory.cpp b/folly/portability/Memory.cpp index 3310c0d2..a589027d 100644 --- a/folly/portability/Memory.cpp +++ b/folly/portability/Memory.cpp @@ -20,8 +20,10 @@ namespace folly { namespace detail { -#if _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || \ - (defined(__ANDROID__) && (__ANDROID_API__ > 15)) +#if _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || \ + (defined(__ANDROID__) && (__ANDROID_API__ > 15)) || \ + (defined(__APPLE__) && (__MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_6 || \ + __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_3_0)) #include // Use posix_memalign, but mimic the behaviour of memalign -- 2.34.1