Restore build on Mac OSX >= 10.7 since the inclusion of ucontext.h

This commit is contained in:
Simon Martin 2014-11-15 20:10:34 +01:00
parent 1a98e0add4
commit 3ca2a177b5
1 changed files with 7 additions and 1 deletions

View File

@ -38,7 +38,13 @@
#include <cstdio> #include <cstdio>
#include <signal.h> #include <signal.h>
#include <unistd.h> #include <unistd.h>
#include <ucontext.h> #if defined(__APPLE__)
# define _XOPEN_SOURCE // ucontext.h APIs can only be used on Mac OSX >= 10.7 if _XOPEN_SOURCE is defined
# include <ucontext.h>
# undef _XOPEN_SOURCE
#else
# include <ucontext.h>
#endif
#ifdef __linux__ #ifdef __linux__
#include <sys/syscall.h> #include <sys/syscall.h>
#include <sys/types.h> #include <sys/types.h>