From b59edbb81af9c2c1a2cb27bb96fc205e32b1deae Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Thu, 25 Feb 2016 21:37:55 +0100 Subject: [PATCH] Fix compilation with GCC when _GNU_SOURCE isn't defined. That is, add some missing headers and bump POSIX compliance to POSIX:2008 which will ensure that 'struct timespec' is defined without funny tricks. --- configure.ac | 4 ++-- src/tools/sysdb/main.c | 1 + src/tools/sysdbd/main.c | 1 + src/utils/os.c | 4 ++++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 85e39c3..c39c4af 100644 --- a/configure.ac +++ b/configure.ac @@ -113,8 +113,8 @@ AC_ARG_ENABLE([standards], if test "x$enable_standards" = "xyes"; then AC_DEFINE([_ISOC99_SOURCE], 1, [Define to enforce ISO/IEC 9899:1999 (C99) compliance.]) - AC_DEFINE([_POSIX_C_SOURCE], 200112L, - [Define to enforce IEEE 1003.1-2001 (POSIX:2001) compliance.]) + AC_DEFINE([_POSIX_C_SOURCE], 200809L, + [Define to enforce IEEE 1003.1-2008 (POSIX:2008) compliance.]) AC_DEFINE([_XOPEN_SOURCE], 700, [Define to enforce X/Open 7 (XSI) compliance.]) AC_DEFINE([_REENTRANT], 1, diff --git a/src/tools/sysdb/main.c b/src/tools/sysdb/main.c index e4922e9..f502027 100644 --- a/src/tools/sysdb/main.c +++ b/src/tools/sysdb/main.c @@ -41,6 +41,7 @@ #include "utils/ssl.h" #include +#include #if HAVE_LIBGEN_H # include diff --git a/src/tools/sysdbd/main.c b/src/tools/sysdbd/main.c index 759eee2..7bfbaa6 100644 --- a/src/tools/sysdbd/main.c +++ b/src/tools/sysdbd/main.c @@ -47,6 +47,7 @@ #endif /* ! HAVE_LIBGEN_H */ #include +#include #include #include diff --git a/src/utils/os.c b/src/utils/os.c index 2b6a514..8ab52c7 100644 --- a/src/utils/os.c +++ b/src/utils/os.c @@ -35,8 +35,11 @@ #include #include +#include #include #include +#include +#include #include @@ -48,6 +51,7 @@ #include #include #include +#include /* * public API -- 2.30.2