summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2025-01-20 09:24:16 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2025-01-31 05:23:39 +0000
commitc0796335d3c6362b563844410499ff241d42ac63 (patch)
tree0ad6296dac51eb2e333f21685e03869268b22ed7
parent7742247d1ca6a9ceaf4120a163362c10150d487f (diff)
downloadedk2-c0796335d3c6362b563844410499ff241d42ac63.tar.gz
MdePkg/BaseFdtLib: fix build with gcc 15
gcc 15 switched to use the new ISO C23 standard by default. 'bool', 'true' and 'false' are keywords in C23, so do not try to define them. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--MdePkg/Library/BaseFdtLib/LibFdtSupport.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/MdePkg/Library/BaseFdtLib/LibFdtSupport.h b/MdePkg/Library/BaseFdtLib/LibFdtSupport.h
index 8a26fbfc32..05f758a93d 100644
--- a/MdePkg/Library/BaseFdtLib/LibFdtSupport.h
+++ b/MdePkg/Library/BaseFdtLib/LibFdtSupport.h
@@ -14,17 +14,21 @@
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
-typedef UINT8 uint8_t;
-typedef UINT16 uint16_t;
-typedef INT32 int32_t;
-typedef UINT32 uint32_t;
-typedef UINT64 uint64_t;
-typedef UINTN uintptr_t;
-typedef UINTN size_t;
-typedef BOOLEAN bool;
-
+typedef UINT8 uint8_t;
+typedef UINT16 uint16_t;
+typedef INT32 int32_t;
+typedef UINT32 uint32_t;
+typedef UINT64 uint64_t;
+typedef UINTN uintptr_t;
+typedef UINTN size_t;
+
+#if defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L
+/* bool, true and false are keywords. */
+#else
+typedef BOOLEAN bool;
#define true (1 == 1)
#define false (1 == 0)
+#endif
//
// Definitions for global constants used by libfdt library routines