From: Yiding Jia Date: Sun, 28 May 2017 18:51:10 +0000 (-0700) Subject: folly/portability/Memory.cpp: restructure preprocessor conditionals so includes are... X-Git-Tag: v2017.05.29.00~1 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3a78d442da886c3720c647fd41c94c0afbf9f8e1;p=folly.git folly/portability/Memory.cpp: restructure preprocessor conditionals so includes are at top level Summary: `#include` inside a namespace is disallowed when using clang modules. Here I just unconditionally include them at top level, since they are available in all the relevant platforms. Reviewed By: yfeldblum, Orvid Differential Revision: D5140355 fbshipit-source-id: bb87225c1d8f4ac64b90a7aff5f912c13e150e3a --- diff --git a/folly/portability/Memory.cpp b/folly/portability/Memory.cpp index f233eb9a..c4a0fff3 100644 --- a/folly/portability/Memory.cpp +++ b/folly/portability/Memory.cpp @@ -17,6 +17,9 @@ #include #include +#include + +#include namespace folly { namespace detail { @@ -24,7 +27,6 @@ namespace detail { (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 void* aligned_malloc(size_t size, size_t align) { @@ -41,7 +43,6 @@ void aligned_free(void* aligned_ptr) { free(aligned_ptr); } #elif defined(_WIN32) -#include // nolint void* aligned_malloc(size_t size, size_t align) { return _aligned_malloc(size, align); @@ -51,7 +52,6 @@ void aligned_free(void* aligned_ptr) { _aligned_free(aligned_ptr); } #else -#include // nolint void* aligned_malloc(size_t size, size_t align) { return memalign(align, size);