diff options
author | Callum Farmer <gmbr3@opensuse.org> | 2023-04-06 21:18:32 +0100 |
---|---|---|
committer | Callum Farmer <gmbr3@opensuse.org> | 2023-04-07 14:13:43 +0100 |
commit | d0900861c2508c47e16b254d4ecb8002b9d95096 (patch) | |
tree | 02c467e40ce7fe3709a2483ac3718163faa5c6f2 | |
parent | 4f8b339facb471192e021fffd5db545a0fbddbc3 (diff) | |
download | gnu-efi-d0900861c2508c47e16b254d4ecb8002b9d95096.tar.gz |
Make NULL compatible with C23/C++
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
-rw-r--r-- | inc/efidef.h | 8 |
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; |