Эх сурвалжийг харах

Make TRUE/FALSE compatible with C23/C++

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
Callum Farmer 2 жил өмнө
parent
commit
2a599ea133
1 өөрчлөгдсөн 5 нэмэгдсэн , 0 устгасан
  1. 5 0
      inc/efidef.h

+ 5 - 0
inc/efidef.h

@@ -34,9 +34,14 @@ typedef bool BOOLEAN;
    #define CONST const
 #endif
 #ifndef TRUE
+#if defined(__cplusplus) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L)
+    #define TRUE    true
+    #define FALSE   false
+#else
     #define TRUE    ((BOOLEAN) 1)
     #define FALSE   ((BOOLEAN) 0)
 #endif
+#endif
 
 #ifndef NULL
     #define NULL    ((VOID *) 0)