From 6042ba010a181acc94c7d947158bc52184f03d7e Mon Sep 17 00:00:00 2001 From: Elyes Haouas Date: Sun, 14 Jul 2024 07:03:09 +0200 Subject: stddef.h: Introduce nullptr constant GCC-13 introduced the nullptr constant. Use it when compiling with the C23 standard. Change-Id: I07db866bebfd25f1a60d18a3228ada2957500234 Signed-off-by: Elyes Haouas Reviewed-on: https://review.coreboot.org/c/coreboot/+/83459 Reviewed-by: Felix Singer Reviewed-by: Julius Werner Tested-by: build bot (Jenkins) --- src/include/stddef.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/include/stddef.h b/src/include/stddef.h index 82d38c3997..352a54f563 100644 --- a/src/include/stddef.h +++ b/src/include/stddef.h @@ -19,7 +19,12 @@ typedef __SIZE_TYPE__ ssize_t; typedef __WCHAR_TYPE__ wchar_t; typedef __WINT_TYPE__ wint_t; +#if __STDC_VERSION__ >= 202300L +#define NULL nullptr +#else +#define nullptr ((void *)0) #define NULL ((void *)0) +#endif /* The devicetree data structures are only mutable in ramstage. All other stages have a constant devicetree. */ -- cgit v1.2.3