diff --git a/src/base/fiber.hh b/src/base/fiber.hh index b9f0683a53..5f7285b297 100644 --- a/src/base/fiber.hh +++ b/src/base/fiber.hh @@ -30,7 +30,16 @@ #ifndef __BASE_FIBER_HH__ #define __BASE_FIBER_HH__ +// ucontext functions (like getcontext, setcontext etc) have been marked +// as deprecated and are hence hidden in latest macOS releases. +// By defining _XOPEN_SOURCE we make them available at compilation time. +#if defined(__APPLE__) && defined(__MACH__) +#define _XOPEN_SOURCE 600 #include +#undef _XOPEN_SOURCE +#else +#include +#endif #include #include