Some functions, such as clock_gettime(), officially require _POSIX_C_SOURCE
to be set to a minimum version in order to be usable.
# Enable GNU extensions.
# Define this here, not in acconfig's @TOP@ section, since definitions
# in the latter don't make it into the configure-time tests.
-AC_GNU_SOURCE
+AC_USE_SYSTEM_EXTENSIONS
AC_DEFINE([__USE_BSD], 1, [Enable BSD extensions])
+AC_DEFINE([_POSIX_C_SOURCE], 200809L, [Enable POSIX features])
dnl Checks for programs.
AM_PROG_CC_C_O
#undef NDEBUG
#endif
+#define _POSIX_C_SOURCE 200809L
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#undef NDEBUG
#endif
+#define _POSIX_C_SOURCE 200809L
+
#include <assert.h>
#include <stdio.h>
#include <unistd.h>
#undef NDEBUG
#endif
+#define _POSIX_C_SOURCE 200809L
+
#include <assert.h>
#include <stdio.h>
#include <unistd.h>
#define _GNU_SOURCE
+#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <stdbool.h>
#define _GNU_SOURCE 1
+#define _POSIX_C_SOURCE 200809L
#ifdef NDEBUG
#undef NDEBUG