diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/base/fiber.hh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/base/fiber.hh b/src/base/fiber.hh index b9f0683a5..5f7285b29 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 <ucontext.h> +#undef _XOPEN_SOURCE +#else +#include <ucontext.h> +#endif #include <cstddef> #include <cstdint> |