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:
Trung Nguyen
2023-09-04 05:58:31 +00:00
committed by Niels Sascha Reedijk
parent c079e6936f
commit ea2870c839
+4
View File
@@ -51,3 +51,7 @@ extern void __assert_perror_fail(int error, const char *file,
#else /* NDEBUG */
# define assert(condition) ((void)0)
#endif
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(static_assert)
# define static_assert _Static_assert
#endif