macros: improve SEL4_COMPILE_ASSERT

- Add underscored in name to improve readability.
- Add brackets to ensure parameters are atoms
- add comment clarifying c99 usage

Signed-off-by: Axel Heider <axelheider@gmx.de>
This commit is contained in:
Axel Heider 2021-06-04 15:33:21 +02:00 committed by Kent McLeod
parent a16324a588
commit 8ecf358ba2

View file

@ -43,7 +43,8 @@
#endif
/* _Static_assert() is a c11 feature. Since the kernel is currently compiled
* with c99, we have to emulate it. */
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
#define SEL4_COMPILE_ASSERT(name, expr) _Static_assert(expr, #name);
#else
@ -53,7 +54,7 @@
#define SEL4_SIZE_SANITY(index, entry, size) \
SEL4_COMPILE_ASSERT(index##entry##size, index + entry == size)
SEL4_COMPILE_ASSERT(index##_##entry##_##size, (index) + (entry) == size)
/*