summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCallum Farmer <gmbr3@opensuse.org>2023-04-06 21:18:32 +0100
committerCallum Farmer <gmbr3@opensuse.org>2023-04-07 14:13:43 +0100
commitd0900861c2508c47e16b254d4ecb8002b9d95096 (patch)
tree02c467e40ce7fe3709a2483ac3718163faa5c6f2
parent4f8b339facb471192e021fffd5db545a0fbddbc3 (diff)
downloadgnu-efi-d0900861c2508c47e16b254d4ecb8002b9d95096.tar.gz
Make NULL compatible with C23/C++
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
-rw-r--r--inc/efidef.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/inc/efidef.h b/inc/efidef.h
index a552c7d..867e21d 100644
--- a/inc/efidef.h
+++ b/inc/efidef.h
@@ -31,7 +31,15 @@ typedef unsigned char BOOLEAN;
#endif
#ifndef NULL
+#if (defined(__cplusplus) && __cplusplus >= 201103L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L)
+ #define NULL nullptr
+#else
+#if !defined(__cplusplus)
#define NULL ((VOID *) 0)
+#else
+ #define NULL 0
+#endif
+#endif
#endif
typedef UINTN EFI_STATUS;