summaryrefslogtreecommitdiffstats
path: root/libelf
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2017-04-03 14:53:37 +0200
committerUlf Hermann <[email protected]>2017-04-26 10:01:29 +0000
commite80dfcbcc3807ba22109d40bc297c5c64c9cc266 (patch)
treee33d23a284b5b283c8d60321d89457be8ece2de4 /libelf
parentfc9596af615b96d73e15b26dc83da14e7bde73c5 (diff)
Avoid double-including config.h
config.h doesn't have include guards, so including it twice is bad. We deal with this by checking for PACKAGE_NAME, but only in some places. Once we start using gnulib, we will need to include config.h before any gnulib-generated headers. This is problematic if we include it transitively through our own private headers. In order to set a clear rule about inclusion of config.h, it is now included in every .c file as first header, but not in any header. This will definitely avoid double-inclusion and satisfy the condition that it has to be included before gnulib headers. It comes at the price of adding some redundancy, but there is no clean way to avoid this. Change-Id: Ib78dd7e058ef8ac93cd379dcd14a2ffbc86c1988 Reviewed-by: Christian Kandeler <[email protected]>
Diffstat (limited to 'libelf')
-rw-r--r--libelf/ChangeLog4
-rw-r--r--libelf/libelfP.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/libelf/ChangeLog b/libelf/ChangeLog
index e32590a7..fa768f85 100644
--- a/libelf/ChangeLog
+++ b/libelf/ChangeLog
@@ -1,5 +1,9 @@
2017-04-20 Ulf Hermann <[email protected]>
+ * libelfP.h: Don't include config.h.
+
+2017-04-20 Ulf Hermann <[email protected]>
+
* elf_begin.c: Use F_GETFD rather than F_GETFL.
2017-04-20 Ulf Hermann <[email protected]>
diff --git a/libelf/libelfP.h b/libelf/libelfP.h
index 44599827..7ee6625a 100644
--- a/libelf/libelfP.h
+++ b/libelf/libelfP.h
@@ -30,10 +30,6 @@
#ifndef _LIBELFP_H
#define _LIBELFP_H 1
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
#include <ar.h>
#include <gelf.h>