libc/minimal/assert: conditionalize static_assert macro

static_assert was not added to C until C11.  Zephyr builds default to
C99.  To preserve compatibility with newlib avoid defining the
macro at standard levels where it did not exist.

Relates to #17738 and #11754.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot 2019-08-19 14:48:47 -05:00 committed by Kumar Gala
parent fbcbe0f11b
commit dfd26dbbeb
1 changed files with 3 additions and 1 deletions

View File

@ -13,8 +13,10 @@
#ifdef __cplusplus
extern "C" {
#else
#if __STDC_VERSION__ >= 201112L
#define static_assert _Static_assert
#endif
#endif /* __STDC_VERSION__ */
#endif /* __cplusplus */
#ifndef NDEBUG
#ifndef assert