mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
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>
This commit is contained in:
committed by
Nicolas Schier
parent
b4ec38cb73
commit
b187c1a1a0
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user