From 09d1b2eac7d11a400fb0806a69f59322ad928af1 Mon Sep 17 00:00:00 2001
From: Juan Carrano <j.carrano@fu-berlin.de>
Date: Tue, 15 May 2018 14:24:28 +0200
Subject: [PATCH] core: Make assert be an expression.

The "verbose" alternative for assert() is now an expression and
can be used in all the places that a funcion call can be used.
---
 core/include/assert.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/core/include/assert.h b/core/include/assert.h
index fe93cde10a..f872e0cdc1 100644
--- a/core/include/assert.h
+++ b/core/include/assert.h
@@ -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
-- 
GitLab