mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
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
|
||||
*/
|
||||
#define assert(cond) \
|
||||
if (!(cond)) { \
|
||||
_assert_failure(RIOT_FILE_RELATIVE, __LINE__); \
|
||||
}
|
||||
#define assert(cond) ((cond) ? (void)0 : _assert_failure(RIOT_FILE_RELATIVE, __LINE__))
|
||||
#else
|
||||
#define assert(cond) ((cond) ? (void)0 : core_panic(PANIC_ASSERT_FAIL, assert_crash_message))
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user