Merge pull request #9136 from jcarrano/fix-assert
core: make assert() an expression.
This commit is contained in:
commit
8fd013635f
@ -101,10 +101,7 @@ NORETURN void _assert_failure(const char *file, unsigned line);
|
|||||||
*
|
*
|
||||||
* @see http://pubs.opengroup.org/onlinepubs/9699919799/functions/assert.html
|
* @see http://pubs.opengroup.org/onlinepubs/9699919799/functions/assert.html
|
||||||
*/
|
*/
|
||||||
#define assert(cond) \
|
#define assert(cond) ((cond) ? (void)0 : _assert_failure(RIOT_FILE_RELATIVE, __LINE__))
|
||||||
if (!(cond)) { \
|
|
||||||
_assert_failure(RIOT_FILE_RELATIVE, __LINE__); \
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
#define assert(cond) ((cond) ? (void)0 : core_panic(PANIC_ASSERT_FAIL, assert_crash_message))
|
#define assert(cond) ((cond) ? (void)0 : core_panic(PANIC_ASSERT_FAIL, assert_crash_message))
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user