aboutsummaryrefslogtreecommitdiffstats
path: root/usr
diff options
authorThomas Weißschuh <linux@weissschuh.net>2026-03-16 17:52:01 +0100
committerNicolas Schier <nsc@kernel.org>2026-03-25 13:24:41 +0100
commitb187c1a1a0513593663b1adee0340d41d833d16d (patch)
treedad7624a0c9508f87875fb3c72d57db65919ff77 /usr
parentb4ec38cb739e9419ddb7310f6c49fb6d7bc39c1d (diff)
downloadlinux-next-history-b187c1a1a0513593663b1adee0340d41d833d16d.tar.gz
kbuild: uapi: provide a C++ compatible dummy definition of NULL
NULL works differently in C++ compared to C. To allow testing the UAPI headers against C++ compilers, provide a variant of NULL which works with those. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Link: https://patch.msgid.link/20260316-kbuild-uapi-c-v2-4-35d6d0ed863f@weissschuh.net Signed-off-by: Nicolas Schier <nsc@kernel.org>
Diffstat (limited to 'usr')
-rw-r--r--usr/dummy-include/stddef.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/usr/dummy-include/stddef.h b/usr/dummy-include/stddef.h
index a61703d1c8963..525489daffe2e 100644
--- a/usr/dummy-include/stddef.h
+++ b/usr/dummy-include/stddef.h
@@ -3,6 +3,11 @@
#define _DUMMY_STDDEF_H
#define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
+
+#ifdef __cplusplus
+#define NULL 0
+#else
#define NULL ((void *)0)
+#endif
#endif /* _DUMMY_STDDEF_H */