headers: Define static_assert for C11
Defines the `static_assert` macro in `assert.h` as required by the C11 standard. Change-Id: Ic25dc99537f995404b7b4280b72c6000a293a1df Reviewed-on: https://review.haiku-os.org/c/haiku/+/6916 Reviewed-by: waddlesplash <[email protected]> Tested-by: Commit checker robot <[email protected]> Reviewed-by: Niels Sascha Reedijk <[email protected]>
This commit is contained in:
committed by
Niels Sascha Reedijk
parent
c079e6936f
commit
ea2870c839
@@ -51,3 +51,7 @@ extern void __assert_perror_fail(int error, const char *file,
|
|||||||
#else /* NDEBUG */
|
#else /* NDEBUG */
|
||||||
# define assert(condition) ((void)0)
|
# define assert(condition) ((void)0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(static_assert)
|
||||||
|
# define static_assert _Static_assert
|
||||||
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user