From: Guus Sliepen Date: Fri, 9 Apr 2021 18:15:56 +0000 (+0200) Subject: Make sure we #define _POSIX_C_SOURCE. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=b052a89622c02b5888c0ca61e52b19e9dbec29c8;p=meshlink Make sure we #define _POSIX_C_SOURCE. Some functions, such as clock_gettime(), officially require _POSIX_C_SOURCE to be set to a minimum version in order to be usable. --- diff --git a/configure.ac b/configure.ac index f9a93259..36488499 100644 --- a/configure.ac +++ b/configure.ac @@ -12,8 +12,9 @@ AM_SILENT_RULES([yes]) # 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 diff --git a/test/blackbox/common/mesh_event_handler.c b/test/blackbox/common/mesh_event_handler.c index 17b5abaf..e00f7d3c 100644 --- a/test/blackbox/common/mesh_event_handler.c +++ b/test/blackbox/common/mesh_event_handler.c @@ -21,6 +21,8 @@ #undef NDEBUG #endif +#define _POSIX_C_SOURCE 200809L + #include #include #include diff --git a/test/channels-aio-fd.c b/test/channels-aio-fd.c index 677944b8..78d9078b 100644 --- a/test/channels-aio-fd.c +++ b/test/channels-aio-fd.c @@ -2,6 +2,8 @@ #undef NDEBUG #endif +#define _POSIX_C_SOURCE 200809L + #include #include #include diff --git a/test/channels-aio.c b/test/channels-aio.c index 25bcea1e..d424b843 100644 --- a/test/channels-aio.c +++ b/test/channels-aio.c @@ -2,6 +2,8 @@ #undef NDEBUG #endif +#define _POSIX_C_SOURCE 200809L + #include #include #include diff --git a/test/stream.c b/test/stream.c index 25aaf2f5..6176b9e4 100644 --- a/test/stream.c +++ b/test/stream.c @@ -1,4 +1,5 @@ #define _GNU_SOURCE +#define _POSIX_C_SOURCE 200809L #include #include diff --git a/test/utils.c b/test/utils.c index 53f83d30..5da829a9 100644 --- a/test/utils.c +++ b/test/utils.c @@ -1,4 +1,5 @@ #define _GNU_SOURCE 1 +#define _POSIX_C_SOURCE 200809L #ifdef NDEBUG #undef NDEBUG