Explorar o código

Make NULL compatible with C23/C++

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
Callum Farmer %!s(int64=2) %!d(string=hai) anos
pai
achega
d0900861c2
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      inc/efidef.h

+ 8 - 0
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;