Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -179,10 +179,24 @@ AS_IF([test x"$PLUGIN_SUFFIX" != x""], [ AC_SUBST(USE_SRCS_PLUGINS, '${SRCS_PLUGINS}') AC_SUBST(TESTPLUGIN, "plugin") AC_DEFINE(OF_HAVE_PLUGINS, 1, [Whether we have plugin support]) ]) + +AC_MSG_CHECKING(whether we need -D_GNU_SOURCE) +AC_EGREP_CPP(yes, [ + #include + + #ifdef __GLIBC__ + yes + #endif +], [ + CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS" + AC_MSG_RESULT(yes) +], [ + AC_MSG_RESULT(no) +]) objc_runtime="ObjFW runtime" AC_CHECK_HEADER(objc/objc.h) AC_MSG_CHECKING(which Objective C runtime to use) AC_ARG_ENABLE(runtime, Index: src/OFDate.m ================================================================== --- src/OFDate.m +++ src/OFDate.m @@ -12,13 +12,10 @@ * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ -#define _POSIX_C_SOURCE 199309L -#define _XOPEN_SOURCE 500 - #include "config.h" #include #include #include Index: src/OFFile.m ================================================================== --- src/OFFile.m +++ src/OFFile.m @@ -12,16 +12,10 @@ * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ -#define _POSIX_C_SOURCE 200112L -#define _XOPEN_SOURCE 600 -#define _BSD_SOURCE -#define _NETBSD_SOURCE -#define _DARWIN_C_SOURCE -#define __BSD_VISIBLE 1 #define __NO_EXT_QNX #include "config.h" /* Work around a bug with Clang + glibc */ Index: src/OFMapTable.m ================================================================== --- src/OFMapTable.m +++ src/OFMapTable.m @@ -12,12 +12,10 @@ * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ -#define _BSD_SOURCE - #include "config.h" #include #include Index: src/OFObject.m ================================================================== --- src/OFObject.m +++ src/OFObject.m @@ -12,12 +12,10 @@ * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ -#define _BSD_SOURCE - #include "config.h" #include #include #include Index: src/OFProcess.m ================================================================== --- src/OFProcess.m +++ src/OFProcess.m @@ -12,12 +12,10 @@ * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ -#define _POSIX_SOURCE - #include "config.h" #include #ifndef _WIN32 Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -13,12 +13,10 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #define OF_THREAD_M -#define _POSIX_C_SOURCE 200112L -#define _POSIX_TIMERS #define __NO_EXT_QNX #include "config.h" #include Index: src/exceptions/OFAddressTranslationFailedException.m ================================================================== --- src/exceptions/OFAddressTranslationFailedException.m +++ src/exceptions/OFAddressTranslationFailedException.m @@ -12,12 +12,10 @@ * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ -#define _BSD_SOURCE - #include "config.h" #import "OFAddressTranslationFailedException.h" #import "OFString.h" Index: src/exceptions/OFException.m ================================================================== --- src/exceptions/OFException.m +++ src/exceptions/OFException.m @@ -12,12 +12,10 @@ * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ -#define _GNU_SOURCE - #include "config.h" #include #ifdef HAVE_DLFCN_H Index: src/of_asprintf.m ================================================================== --- src/of_asprintf.m +++ src/of_asprintf.m @@ -12,12 +12,10 @@ * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ -#define _GNU_SOURCE - #include "config.h" #include #include #include