]> git.ipfire.org Git - thirdparty/elfutils.git/commit
lib: Prevent double inclusion of config.h through system.h
authorMark Wielaard <mark@klomp.org>
Fri, 4 Apr 2025 11:50:04 +0000 (13:50 +0200)
committerMark Wielaard <mark@klomp.org>
Sun, 6 Apr 2025 16:31:37 +0000 (18:31 +0200)
commitf33f4c85581045ae493e7f12c6ba1bf5829d8192
treea36fd8c1b6085c8a7e8c0e1434a64698add438d7
parent3b71249d4396f742d68e774313c2a2d9caf4d668
lib: Prevent double inclusion of config.h through system.h

Files that include both <config.h> and "system.h" might include
config.h twice. Prevent that by adding a guard check in system.h
before including config.h.

       * lib/crc32.c: Use #ifdef HAVE_CONFIG_H instead of #if.
       * lib/error.h: Check HAVE_CONFIG_H before including config.h.
       * lib/system.h: Check both HAVE_CONFIG_H and whether
       EU_CONFIG_H is defined before including config.h.

Suggested-by: Dmitry V. Levin <ldv@strace.io>
Signed-off-by: Mark Wielaard <mark@klomp.org>
lib/crc32.c
lib/error.c
lib/system.h