aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/dso
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2005-06-06 00:50:52 +0000
committerRichard Levitte <levitte@openssl.org>2005-06-06 00:50:52 +0000
commit3ecbd099ebdb89bbcd18ca28cf484dbf84589a89 (patch)
treebf9e8de7287f28c6a983f85d94b54ffdeb43ff89 /crypto/dso
parente43d03e30e58c392b8596406d5573e78c6a8f52b (diff)
downloadopenssl-3ecbd099ebdb89bbcd18ca28cf484dbf84589a89.tar.gz
_GNU_SOURCE needs to be defined before any standard header.
Diffstat (limited to 'crypto/dso')
-rw-r--r--crypto/dso/dso_dlfcn.c15
1 files changed, 10 insertions, 5 deletions
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 <stdio.h>
#include "cryptlib.h"
#include <openssl/dso.h>
@@ -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 <dlfcn.h>
#endif