https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117857
--- Comment #12 from Iain Sandoe <iains at gcc dot gnu.org> --- it looks like this ... #if !defined(__DARWIN_UNIX03) #if defined(_APPLE_C_SOURCE) || defined(_XOPEN_SOURCE) || defined(_POSIX_C_SOURCE) || defined(__LP64__) #if defined(_NONSTD_SOURCE) #error "Can't define both _NONSTD_SOURCE and any of _APPLE_C_SOURCE, _XOPEN_SOURCE, _POSIX_C_SOURCE, or __LP64__" #endif /* _NONSTD_SOURCE */ #define __DARWIN_UNIX03 1 .... So perhaps, in this case, setting __DARWIN_UNIX03 would work - but that's only looking at the cdefs header .. there might well be other cases... So I guess you could try forcing -D_APPLE_C_SOURCE ... Otherwise you'd have to check under what conditions it's OK to define _XOPEN_SOURCE. _POSIX_C_SOURCE is also a derived flag IIRC (and is maybe/probably not set for C++) ..