diff --git a/src/base/fiber.cc b/src/base/fiber.cc index af63216da2..177459aaae 100644 --- a/src/base/fiber.cc +++ b/src/base/fiber.cc @@ -33,6 +33,14 @@ #include #endif +// Mac OS requires _DARWIN_C_SOURCE if _POSIX_C_SOURCE is defined, +// otherwise it will mask the definition of MAP_ANONYMOUS. +// _POSIX_C_SOURCE is already defined by including in +// base/fiber.hh +#if defined(__APPLE__) && defined(__MACH__) +#define _DARWIN_C_SOURCE +#endif + #include #include