summaryrefslogtreecommitdiff
path: root/libebl
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
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')
-rw-r--r--libebl/ChangeLog4
-rw-r--r--libebl/libebl.h4
2 files changed, 7 insertions, 1 deletions
diff --git a/libebl/ChangeLog b/libebl/ChangeLog
index fa6dd037..e54aa2c9 100644
--- a/libebl/ChangeLog
+++ b/libebl/ChangeLog
@@ -1,3 +1,7 @@
+2020-07-19 Mark Wielaard <mark@klomp.org>
+
+ * libebl.h: Only typedef Ebl if _LIBASM_H is undefined.
+
2020-06-10 Mark Wielaard <mark@klomp.org>
* eblopenbackend.c (i386_init, sh_init, x86_64_init, ia64_init,
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