diff options
author | David Härdeman <david@hardeman.nu> | 2020-06-21 21:39:15 +0200 |
---|---|---|
committer | David Härdeman <david@hardeman.nu> | 2020-06-21 21:39:15 +0200 |
commit | 0ba4f18ea6981b4d2b4eded11b2da4b2a2192d5b (patch) | |
tree | b10104c574b719cf78f10945526a21a9fd385d64 /main.h | |
parent | 003159e92bb4526845a8a1a1a4627824e939cd4b (diff) |
Finish up the assert conversion
Diffstat (limited to 'main.h')
-rw-r--r-- | main.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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)) { \ |