core: make ASSERT_NEVER_CALLED a single statement

This way, the macro can be used as a body of an if statement with no
curly braces.
This commit is contained in:
Norman Feske 2019-01-28 14:35:52 +01:00
parent 3a169d3a78
commit 437e6c5653

View File

@ -18,8 +18,10 @@
#include <base/log.h>
#define ASSERT_NEVER_CALLED \
Genode::error("Unexpected call of '", __FUNCTION__, "' " \
"(", __FILE__, ":", __LINE__, ")"); \
for (;;); throw 0UL;
do { \
Genode::error("Unexpected call of '", __FUNCTION__, "' " \
"(", __FILE__, ":", __LINE__, ")"); \
for (;;); throw 0UL; \
} while (false)
#endif /* _CORE__INCLUDE__ASSERTION_H_ */