From 2a599ea13337d1fb2f9e4402b67f8a88db6a8502 Mon Sep 17 00:00:00 2001 From: Callum Farmer Date: Sat, 15 Apr 2023 14:31:38 +0100 Subject: [PATCH] Make TRUE/FALSE compatible with C23/C++ Signed-off-by: Callum Farmer --- inc/efidef.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inc/efidef.h b/inc/efidef.h index 3816331..d9fd8b3 100644 --- a/inc/efidef.h +++ b/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)