Merge pull request #463 from simartin/ucontext_h_macosx_gt_10_7

Restore build on Mac OSX >= 10.7 since the inclusion of ucontext.h
This commit is contained in:
amai2012 2014-11-15 21:09:01 +01:00
commit 2f7f4b849e
1 changed files with 7 additions and 1 deletions

View File

@ -38,7 +38,13 @@
#include <cstdio>
#include <signal.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__
#include <sys/syscall.h>
#include <sys/types.h>