It is needed when defining a specific value of _XOPEN_SOURCE.
CHECK_LIBRARY_EXISTS(rt clock_gettime "" HAVE_POSIX_GETTIME)
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
- set(CMAKE_REQUIRED_DEFINITIONS "-D_XOPEN_SOURCE=700")
+ set(CMAKE_REQUIRED_DEFINITIONS "-D_XOPEN_SOURCE=700 -D_")
endif()
CHECK_INCLUDE_FILES("time.h;sys/time.h" TIME_WITH_SYS_TIME)
# This is needed for ucontext on MacOS X:
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
- add_definitions(-D_XOPEN_SOURCE=700)
+ add_definitions(-D_XOPEN_SOURCE=700 -D_DARWIN_C_SOURCE)
endif()
if(WIN32)
# Try to make Mac a bit more complient to open source standards
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=700")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=700 -D_DARWIN_C_SOURCE")
endif()
set(TESH_OPTION "")