From 41f73b0a45ba3e63ac33ebdc99f12481f5b7cdab Mon Sep 17 00:00:00 2001 From: katherine Date: Fri, 20 Dec 2019 09:28:54 -0700 Subject: implement printing --- src/err.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/err.h (limited to 'src/err.h') diff --git a/src/err.h b/src/err.h new file mode 100644 index 0000000..dd097fc --- /dev/null +++ b/src/err.h @@ -0,0 +1,19 @@ +#ifndef EVERY_ERR_H +#define EVERY_ERR_H + +#include +#include + +#define ERRM(...) \ + do { \ + fprintf(stderr, "err: " __VA_ARGS__); \ + fprintf(stderr, "\n"); \ + } while (0) + +#define ERR(...) \ + do { \ + ERRM(__VA_ARGS__); \ + exit(EXIT_FAILURE); \ + } while (0) + +#endif -- cgit v1.2.3