1
0
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:
Kaspar Schleiser 2018-05-15 21:38:14 +02:00 committed by GitHub
commit 8fd013635f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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