summaryrefslogtreecommitdiff
path: root/include/coff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-07-30 10:26:07 -0600
committerTom Tromey <tromey@adacore.com>2023-08-03 07:39:15 -0600
commitf559e52a8e79585e0b13156e949a7fd46060a714 (patch)
tree9ccc07385f1c6e11b233b4b711f8cbd37ddf8d45 /include/coff
parentf8c4789c7f4efa3726ec39256b9860e4df9f8177 (diff)
Remove PEI_HEADERS define
I noticed a few files double-included libcoff.h, and digging deeper I found that the PEI_HEADERS define is a sort of external include guard. This patch adds include guards to the few files in include/coff that were missing one, and then removes the PEI_HEADERS workaround and the redundant includes. I didn't see anything in these files that indicated that double-inclusion would be useful, so it seems to me that this approach is ok. Tested by rebuilding with --enable-targets=all. 2023-08-02 Tom Tromey <tromey@adacore.com> * pei-x86_64.c (PEI_HEADERS): Do not define. * pei-loongarch64.c (PEI_HEADERS): Do not define. * pei-aarch64.c (PEI_HEADERS): Do not define. * pe-x86_64.c (PEI_HEADERS): Do not define. * pe-aarch64.c (PEI_HEADERS): Do not define. * libpei.h (_LIBPEI_H): Add include guard. * coff-x86_64.c (PEI_HEADERS): Do not check. * coff-loongarch64.c (PEI_HEADERS): Do not check. * coff-aarch64.c (PEI_HEADERS): Do not check. include/ChangeLog 2023-08-02 Tom Tromey <tromey@adacore.com> * coff/x86_64.h (COFF_X86_64_H): Add include guard. * coff/loongarch64.h (COFF_LOONGARCH64_H): Add include guard. * coff/aarch64.h (COFF_AARCH64_H): Add include guard.
Diffstat (limited to 'include/coff')
-rw-r--r--include/coff/aarch64.h5
-rw-r--r--include/coff/loongarch64.h5
-rw-r--r--include/coff/x86_64.h5
3 files changed, 15 insertions, 0 deletions
diff --git a/include/coff/aarch64.h b/include/coff/aarch64.h
index 4616cfef2b8..a3f2bcb76f7 100644
--- a/include/coff/aarch64.h
+++ b/include/coff/aarch64.h
@@ -17,6 +17,9 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
+#ifndef COFF_AARCH64_H
+#define COFF_AARCH64_H
+
#define COFFAARCH64 1
#define L_LNNO_SIZE 2
@@ -82,3 +85,5 @@ struct external_reloc
#define IMAGE_REL_ARM64_REL32 0x0011 /* The 32-bit relative address from the byte following the relocation. */
#define ARM_NOTE_SECTION ".note"
+
+#endif /* COFF_AARCH64_H */
diff --git a/include/coff/loongarch64.h b/include/coff/loongarch64.h
index 5a21bcf9976..d273881623a 100644
--- a/include/coff/loongarch64.h
+++ b/include/coff/loongarch64.h
@@ -17,6 +17,9 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
+#ifndef COFF_LOONGARCH64_H
+#define COFF_LOONGARCH64_H
+
#define COFFLOONGARCH64 1
#define L_LNNO_SIZE 2
@@ -59,3 +62,5 @@ struct external_reloc
#define RELOC struct external_reloc
#define RELSZ 14
+
+#endif /* COFF_LOONGARCH64_H */
diff --git a/include/coff/x86_64.h b/include/coff/x86_64.h
index 9980a84a835..3be9ee3874c 100644
--- a/include/coff/x86_64.h
+++ b/include/coff/x86_64.h
@@ -20,6 +20,9 @@
Written by Kai Tietz, OneVision Software GmbH&CoKg. */
+#ifndef COFF_X86_64_H
+#define COFF_X86_64_H
+
#define L_LNNO_SIZE 2
#define INCLUDE_COMDAT_FIELDS_IN_AUXENT
@@ -105,3 +108,5 @@ struct external_reloc
#define R_PCRBYTE 18
#define R_PCRWORD 19
#define R_PCRLONG 20
+
+#endif /* COFF_X86_64_H */