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.

tools/nolibc: add __nolibc_static_assert()

Add a wrapper for _Static_assert() to use within nolibc.
While _Static_assert() itself was only standardized in C11,
in GCC and clang dialects it is also available in older standards.

Link: https://lore.kernel.org/lkml/20251203192330.GA12995@1wt.eu/
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20251220-nolibc-uapi-types-v3-13-c662992f75d7@weissschuh.net

+8
+8
tools/include/nolibc/compiler.h
··· 63 63 # define __nolibc_clang_version 0 64 64 #endif /* __clang__ */ 65 65 66 + #if __STDC_VERSION__ >= 201112L || \ 67 + __nolibc_gnuc_version >= __nolibc_version(4, 6, 0) || \ 68 + __nolibc_clang_version >= __nolibc_version(3, 0, 0) 69 + # define __nolibc_static_assert(_t) _Static_assert(_t, "") 70 + #else 71 + # define __nolibc_static_assert(_t) 72 + #endif 73 + 66 74 #endif /* _NOLIBC_COMPILER_H */