From: Joel Marcey Date: Fri, 27 Jun 2014 21:46:19 +0000 (-0700) Subject: Fix folly on OSX and BSD in prep for FastCGI on HHVM X-Git-Tag: v0.22.0~489 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=75f93a6620f11ebbb5453dea49a8bf201e25b390;p=folly.git Fix folly on OSX and BSD in prep for FastCGI on HHVM Summary: A recent change in folly/MemoryMapping.cpp uses MAP_ANONYMOUS, which is named MAP_ANON on OSX/BSD. We need folly and third-party changes in order to land a pull request for HHVM that starts to get FastCGI running on OSX. See the checklist of the HHVM pull request here: https://github.com/facebook/hhvm/pull/2944#issuecomment-47281003 Closes #67 GitHub Author: Daniel Sloof @override-unit-failures Test Plan: fbmake runtests 100% Reviewed By: pt@fb.com, njormrod@fb.com FB internal diff: D1407393 --- diff --git a/folly/MemoryMapping.cpp b/folly/MemoryMapping.cpp index 17f06be3..a6ad326a 100644 --- a/folly/MemoryMapping.cpp +++ b/folly/MemoryMapping.cpp @@ -16,6 +16,7 @@ #include "folly/MemoryMapping.h" #include "folly/Format.h" +#include "folly/Portability.h" #ifdef __linux__ #include "folly/experimental/io/HugePages.h" diff --git a/folly/Portability.h b/folly/Portability.h index 68d7d969..989f11d5 100644 --- a/folly/Portability.h +++ b/folly/Portability.h @@ -34,6 +34,16 @@ #endif #endif +// A change in folly/MemoryMapping.cpp uses MAP_ANONYMOUS, which is named +// MAP_ANON on OSX/BSD. +#if defined(__APPLE__) || defined(__FreeBSD__) + #include + #ifndef MAP_ANONYMOUS + #ifdef MAP_ANON + #define MAP_ANONYMOUS MAP_ANON + #endif + #endif +#endif // MaxAlign: max_align_t isn't supported by gcc #ifdef __GNUC__