From 0ba4f18ea6981b4d2b4eded11b2da4b2a2192d5b Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Sun, 21 Jun 2020 21:39:15 +0200 Subject: Finish up the assert conversion --- main.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'main.h') 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)) { \ -- cgit v1.2.3