Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Thomas Weißschuh and committed by
Nicolas Schier
b187c1a1 b4ec38cb

+5
+5
usr/dummy-include/stddef.h
··· 3 3 #define _DUMMY_STDDEF_H 4 4 5 5 #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER) 6 + 7 + #ifdef __cplusplus 8 + #define NULL 0 9 + #else 6 10 #define NULL ((void *)0) 11 + #endif 7 12 8 13 #endif /* _DUMMY_STDDEF_H */