It seems that some BSD systems have bugs in their handling of the
_XOPEN_SOURCE macro (which is supposed to turn on certain POSIX and OPEN UNIX
standard behaviors so we can depend on things like thread-safe/reentrant
behaviors and consistent structure layouts in standard system libraries). I
turned that on to get reliable IPV6 data structure layouts and because Solaris
(and presumably other systems) actually still uses non thead-safe errno by
default, but it' s triggering this BSD bug on your systems.
Most UNIX systems use these macros to restrict the available APIs so that you
can be certain that you are not using any functions that are not present in the
spec. If you are targeting POSIX systems, you turn on the POSIX macro and no
libc functions outside of POSIX are visible.
glibc, just to be different, uses them the opposite way and requires you to
specify them to enable features - it defaults to basically not being able to
compile any nontrivial C functions.
Therefore, if you add any of these macros, your most likely outcome is to break
the build everywhere except GNU/Linux.