summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorElyes Haouas <ehaouas@noos.fr>2024-07-14 07:03:09 +0200
committerElyes Haouas <ehaouas@noos.fr>2024-10-03 02:05:44 +0000
commit6042ba010a181acc94c7d947158bc52184f03d7e (patch)
treed37080e1a43d9a001a3881f5c4a6fefd11c8db36 /src
parenteee5c10c945c519710670da6bed84f612e330a98 (diff)
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 <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/83459 Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de> Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r--src/include/stddef.h5
1 files changed, 5 insertions, 0 deletions
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. */