summaryrefslogtreecommitdiff
path: root/libebl/libebl.h
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2020-07-19 21:51:16 +0200
committerMark Wielaard <mark@klomp.org>2020-07-23 22:46:46 +0200
commit15495182302edbe0142101ec3a09e478901ab994 (patch)
tree5c9815b156d25a8f5dc1d5700108e28a7866c2ba /libebl/libebl.h
parent4a3f7f0e4dc1ad2906d05a1014d74c4728817965 (diff)
downloadelfutils-15495182302edbe0142101ec3a09e478901ab994.tar.gz
Only typedef Ebl once.
Since commit 287a18452 libasm.h defines an opague Ebl handle. This is fine, except for (internal) code that also includes libebl.h. Since C11 having multiple typedefs for the same thing is fine, but we do build using GNU/C99. This also allows multiple same typedefs, except for (very) old GCCs. This only affects internal code, since libebl.h isn't a public header. For internal code, only add the typedef in libebl.h when libasm.h hasn't been included. Make sure all code that includes both headers includes libasm.h first. Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'libebl/libebl.h')
-rw-r--r--libebl/libebl.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libebl/libebl.h b/libebl/libebl.h
index 06a14c45..23c0e950 100644
--- a/libebl/libebl.h
+++ b/libebl/libebl.h
@@ -45,8 +45,10 @@
#include "elf-knowledge.h"
-/* Opaque type for the handle. */
+/* Opaque type for the handle. libasm.h defined the same thing. */
+#ifndef _LIBASM_H
typedef struct ebl Ebl;
+#endif
#ifdef __cplusplus