]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Only typedef Ebl once.
authorMark Wielaard <mark@klomp.org>
Sun, 19 Jul 2020 19:51:16 +0000 (21:51 +0200)
committerMark Wielaard <mark@klomp.org>
Thu, 23 Jul 2020 20:46:46 +0000 (22:46 +0200)
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>
14 files changed:
libasm/ChangeLog
libasm/libasmP.h
libebl/ChangeLog
libebl/libebl.h
tests/ChangeLog
tests/asm-tst1.c
tests/asm-tst2.c
tests/asm-tst3.c
tests/asm-tst4.c
tests/asm-tst5.c
tests/asm-tst6.c
tests/asm-tst7.c
tests/asm-tst8.c
tests/asm-tst9.c

index 8ed7fc201aa429f37ea24760d3b3ce55569f6074..83a65492327061613bb6ac21ad0d50cff4bf3d25 100644 (file)
@@ -1,3 +1,7 @@
+2020-07-19  Mark Wielaard  <mark@klomp.org>
+
+       * libasmP.h: Include libebl.h after libasm.h.
+
 2020-07-05  Mark Wielaard  <mark@klomp.org>
 
        * libasm.h: Include gelf.h.
index a4703fc3255491f8933293ef1e974a3d65dbe22a..53d8f3a081a925bcd97e4fae76d79a632302bed3 100644 (file)
@@ -31,8 +31,8 @@
 
 #include <stdio.h>
 
-#include "libebl.h"
 #include <libasm.h>
+#include "libebl.h"
 
 #include "libdwelf.h"
 
index fa6dd0373af3a58dbdb8083b5ed4caec43726388..e54aa2c90e4636c8216a7fb9eec71373720bf097 100644 (file)
@@ -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,
index 06a14c45af47388ce8cb3c8b13a38da236b2f067..23c0e95018af849603ee6f87be4d1ff3c89ca3f4 100644 (file)
 #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
index b5d332a0b57b340b88e99ae193553d5ee0e63703..047100b09740baa60ee631810a5a4cc491ff2883 100644 (file)
@@ -1,3 +1,15 @@
+2020-07-19  Mark Wielaard  <mark@klomp.org>
+
+       * asm-tst1.c: Include libebl.h after libasm.h.
+       * asm-tst2.c: Likewise.
+       * asm-tst3.c: Likewise.
+       * asm-tst4.c: Likewise.
+       * asm-tst5.c: Likewise.
+       * asm-tst6.c: Likewise.
+       * asm-tst7.c: Likewise.
+       * asm-tst8.c: Likewise.
+       * asm-tst9.c: Likewise.
+
 2020-07-05  Mark Wielaard  <mark@klomp.org>
 
        * run-test-includes.sh: New test.
index cdf2a921a97521871806add3f3e70a70f1f93274..d03a4361d4fda818f27b81b1d72942ff1e654624 100644 (file)
@@ -20,8 +20,8 @@
 #endif
 
 #include <fcntl.h>
-#include ELFUTILS_HEADER(ebl)
 #include ELFUTILS_HEADER(asm)
+#include ELFUTILS_HEADER(ebl)
 #include <libelf.h>
 #include <stdio.h>
 #include <string.h>
index 9e88b70cefdaf90b66dfc20964c51217cb24521f..e65a9d2fd93f03b8de52b009d02f66b99e797971 100644 (file)
@@ -20,8 +20,8 @@
 #endif
 
 #include <fcntl.h>
-#include ELFUTILS_HEADER(ebl)
 #include ELFUTILS_HEADER(asm)
+#include ELFUTILS_HEADER(ebl)
 #include <libelf.h>
 #include <stdio.h>
 #include <string.h>
index 39c1d90c1ed54109f4d645298398431c2567997c..e45fa16af573bfc0bdf4802c695d46280695e3f2 100644 (file)
@@ -20,8 +20,8 @@
 #endif
 
 #include <fcntl.h>
-#include ELFUTILS_HEADER(ebl)
 #include ELFUTILS_HEADER(asm)
+#include ELFUTILS_HEADER(ebl)
 #include <libelf.h>
 #include <stdio.h>
 #include <string.h>
index 5114938b8986207459eb27fdf0eed5d3c4445406..1a05bfcc97f8b5fa01a726fc4c6ea524f5b39de2 100644 (file)
@@ -20,8 +20,8 @@
 #endif
 
 #include <fcntl.h>
-#include ELFUTILS_HEADER(ebl)
 #include ELFUTILS_HEADER(asm)
+#include ELFUTILS_HEADER(ebl)
 #include <libelf.h>
 #include <stdio.h>
 #include <stdlib.h>
index dcb852f81770b28d7579568b39714127c93e99e9..256873f00d171fd1068a57dc51a14abc4800cae0 100644 (file)
@@ -20,8 +20,8 @@
 #endif
 
 #include <fcntl.h>
-#include ELFUTILS_HEADER(ebl)
 #include ELFUTILS_HEADER(asm)
+#include ELFUTILS_HEADER(ebl)
 #include <libelf.h>
 #include <stdio.h>
 #include <stdlib.h>
index 829cd90cda0ae6ecf27e1ac317bedcf0e6c593de..4a665ed02249c6fa9e3d36bc34b9334470a7c211 100644 (file)
@@ -19,8 +19,8 @@
 # include <config.h>
 #endif
 
-#include ELFUTILS_HEADER(ebl)
 #include ELFUTILS_HEADER(asm)
+#include ELFUTILS_HEADER(ebl)
 #include <libelf.h>
 #include <stdio.h>
 #include <stdlib.h>
index 901797695c5eb2040cd4c1205f9eae5656734f32..87c214858a867b13764c7b87aef7106345d23ee8 100644 (file)
@@ -21,8 +21,8 @@
 
 #include <fcntl.h>
 #include <inttypes.h>
-#include ELFUTILS_HEADER(ebl)
 #include ELFUTILS_HEADER(asm)
+#include ELFUTILS_HEADER(ebl)
 #include <libelf.h>
 #include <stdio.h>
 #include <unistd.h>
index a65509fef1fede54f4062cc62bfa0172771cce6f..7dbac10fac79de18beb370d163a1f3682901a25c 100644 (file)
@@ -21,8 +21,8 @@
 
 #include <fcntl.h>
 #include <inttypes.h>
-#include ELFUTILS_HEADER(ebl)
 #include ELFUTILS_HEADER(asm)
+#include ELFUTILS_HEADER(ebl)
 #include <libelf.h>
 #include <stdio.h>
 #include <unistd.h>
index 681e872df020e7c924138ab9a5db25a33068010e..6bec3f6ef24aa7088ca5030d77462d4f8663a21c 100644 (file)
@@ -21,8 +21,8 @@
 
 #include <fcntl.h>
 #include <inttypes.h>
-#include ELFUTILS_HEADER(ebl)
 #include ELFUTILS_HEADER(asm)
+#include ELFUTILS_HEADER(ebl)
 #include <libelf.h>
 #include <stdio.h>
 #include <string.h>