diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2017-04-20 16:31:02 +0200 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2017-05-02 13:28:54 +0200 |
commit | 575198c29a427392823cc8f2400579a23d06a875 (patch) | |
tree | f58d3f9bd42e16dfc6c58d26a56e0dfda960c7a0 /libdwfl/dwfl_module_getsym.c | |
parent | fd9e7345b41eb2d6c11e0b8679e19df68e20171e (diff) | |
download | elfutils-575198c29a427392823cc8f2400579a23d06a875.tar.gz |
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.
Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'libdwfl/dwfl_module_getsym.c')
-rw-r--r-- | libdwfl/dwfl_module_getsym.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libdwfl/dwfl_module_getsym.c b/libdwfl/dwfl_module_getsym.c index 42d2b679..8de9a3eb 100644 --- a/libdwfl/dwfl_module_getsym.c +++ b/libdwfl/dwfl_module_getsym.c @@ -26,6 +26,10 @@ the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + #include "libdwflP.h" const char * |