aboutsummaryrefslogtreecommitdiffstats
path: root/src/err.h
diff options
context:
space:
mode:
authorkatherine <ageha@airen-no-jikken.icu>2019-12-20 09:28:54 -0700
committerkatherine <ageha@airen-no-jikken.icu>2019-12-20 09:28:54 -0700
commit41f73b0a45ba3e63ac33ebdc99f12481f5b7cdab (patch)
treecb863c4372a1386a27cd1e655afeeb160f396d46 /src/err.h
parent31632d4edbd903826cbf8f6bb93969f0d1a983fb (diff)
downloadevery-41f73b0a45ba3e63ac33ebdc99f12481f5b7cdab.tar.gz
implement printing
Diffstat (limited to 'src/err.h')
-rw-r--r--src/err.h19
1 files changed, 19 insertions, 0 deletions
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 <stdio.h>
+#include <stdlib.h>
+
+#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