From 08d7465f5a841366ec4c66f11475ede4e9082a8d Mon Sep 17 00:00:00 2001 From: ubq323 Date: Mon, 24 Jun 2024 16:49:15 +0100 Subject: refactor error checking and argument parsing --- util.h | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 util.h (limited to 'util.h') diff --git a/util.h b/util.h new file mode 100644 index 0000000..b0f2658 --- /dev/null +++ b/util.h @@ -0,0 +1,10 @@ +#ifndef _util_h +#define _util_h + +#define CHECK(cond, ...) do { if (!(cond)) { fprintf(stderr, __VA_ARGS__); exit(1); } } while(0) +#define ERROR(...) CHECK(false, __VA_ARGS__) + + + +#endif + -- cgit v1.2.3