Skip to content

Commit 3ca2a17

Browse files
committed
Restore build on Mac OSX >= 10.7 since the inclusion of ucontext.h
1 parent 1a98e0a commit 3ca2a17

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

cli/cppcheckexecutor.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@
3838
#include <cstdio>
3939
#include <signal.h>
4040
#include <unistd.h>
41-
#include <ucontext.h>
41+
#if defined(__APPLE__)
42+
# define _XOPEN_SOURCE // ucontext.h APIs can only be used on Mac OSX >= 10.7 if _XOPEN_SOURCE is defined
43+
# include <ucontext.h>
44+
# undef _XOPEN_SOURCE
45+
#else
46+
# include <ucontext.h>
47+
#endif
4248
#ifdef __linux__
4349
#include <sys/syscall.h>
4450
#include <sys/types.h>

0 commit comments

Comments
 (0)