From: Richard Levitte Date: Mon, 6 Jun 2005 00:50:52 +0000 (+0000) Subject: _GNU_SOURCE needs to be defined before any standard header. X-Git-Tag: OpenSSL_0_9_8k^2~2038 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3ecbd099ebdb89bbcd18ca28cf484dbf84589a89;p=oweals%2Fopenssl.git _GNU_SOURCE needs to be defined before any standard header. --- diff --git a/crypto/dso/dso_dlfcn.c b/crypto/dso/dso_dlfcn.c index 67a0f3291c..56756cf541 100644 --- a/crypto/dso/dso_dlfcn.c +++ b/crypto/dso/dso_dlfcn.c @@ -56,6 +56,16 @@ * */ +/* We need to do this early, because stdio.h includes the header files + that handle _GNU_SOURCE and other similar macros. Defining it later + is simply too late, because those headers are protected from re- + inclusion. */ +#ifdef __linux +# ifndef _GNU_SOURCE +# define _GNU_SOURCE /* make sure dladdr is declared */ +# endif +#endif + #include #include "cryptlib.h" #include @@ -69,11 +79,6 @@ DSO_METHOD *DSO_METHOD_dlfcn(void) #ifdef HAVE_DLFCN_H -#ifdef __linux -# ifndef _GNU_SOURCE -# define _GNU_SOURCE /* make sure dladdr is declared */ -# endif -#endif #include #endif