Skip to content

build: Bump _XOPEN_SOURCE to 700

Ting-Wei Lan requested to merge wip/lantw/build-Bump-_XOPEN_SOURCE-to-700 into master

On FreeBSD, macros such as _POSIX_C_SOURCE and _XOPEN_SOURCE are used as a means to disable features instead of enabling features. Therefore, setting a macro to a value which is too small can make required features become unavailable.

Commit f57bec33 sets _XOPEN_SOURCE to 500 and causes compilation errors on FreeBSD because of missing C99 support. FreeBSD libc automatically sets _POSIX_C_SOURCE to 199506 when _XOPEN_SOURCE is set to 500. Since 1995 < 1999, this also means all C99 functions are disabled. To fix it, use a value matching the current definition of _POSIX_C_SOURCE=200809, which is _XOPEN_SOURCE=700.

Merge request reports