aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/core/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/osmocom/core/utils.h')
-rw-r--r--include/osmocom/core/utils.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h
index 7625da16..182da08d 100644
--- a/include/osmocom/core/utils.h
+++ b/include/osmocom/core/utils.h
@@ -111,9 +111,11 @@ do { \
* the predicate evaluates to false (0).
*/
#define OSMO_ASSERT(exp) \
+do { \
if (!(exp)) { \
osmo_panic("Assert failed %s %s:%d\n", #exp, __FILE__, __LINE__); \
- }
+ } \
+} while (0); /* some code invokes OSMO_ASSERT() without the semicolon */
/*! duplicate a string using talloc and release its prior content (if any)
* \param[in] ctx Talloc context to use for allocation