summaryrefslogtreecommitdiff
path: root/main.h
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-06-21 21:39:15 +0200
committerDavid Härdeman <david@hardeman.nu>2020-06-21 21:39:15 +0200
commit0ba4f18ea6981b4d2b4eded11b2da4b2a2192d5b (patch)
treeb10104c574b719cf78f10945526a21a9fd385d64 /main.h
parent003159e92bb4526845a8a1a1a4627824e939cd4b (diff)
Finish up the assert conversion
Diffstat (limited to 'main.h')
-rw-r--r--main.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/main.h b/main.h
index ccd7221..9759ecf 100644
--- a/main.h
+++ b/main.h
@@ -73,6 +73,18 @@ void __die(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
return __VA_ARGS__; \
} while (0)
+#define assert_return_silent(expr, ...) \
+ do { \
+ if (!(expr)) \
+ return __VA_ARGS__; \
+ } while (0)
+
+#define assert_die(expr, msg) \
+ do { \
+ if (!assert_log(expr, #expr)) \
+ die(msg); \
+ } while (0)
+
#define assert_task_alive_or(lvl, t, cmd) \
do { \
if (!(t)) { \