1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

core/assert: allow multiple static_asserts

Uses an own scope for the definition of the enum const to allow multiple `static_assert` statements within the same function in non-C11 environments.
This commit is contained in:
Gunar Schorcht 2019-10-19 15:52:59 +02:00
parent 855ef72202
commit 54e915eec5

View File

@ -119,7 +119,7 @@ NORETURN void _assert_failure(const char *file, unsigned line);
* Generates a division by zero compile error when cond is false
*/
#define static_assert(cond, ...) \
enum { static_assert_failed_on_div_by_0 = 1 / (!!(cond)) }
{ enum { static_assert_failed_on_div_by_0 = 1 / (!!(cond)) }; }
#endif
#endif