aboutsummaryrefslogtreecommitdiff
path: root/src/err.h
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2021-12-30 14:18:15 +0100
committerElias Fleckenstein <eliasfleckenstein@web.de>2021-12-30 14:18:15 +0100
commitecc06c082036aa93f6810ec21e73610c55f5a57b (patch)
treeaff479c3bc5b39ead9f65dffb01d399b341fa4ba /src/err.h
downloaduwu-lang-ecc06c082036aa93f6810ec21e73610c55f5a57b.tar.xz
Initial commit
Diffstat (limited to 'src/err.h')
-rw-r--r--src/err.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/err.h b/src/err.h
new file mode 100644
index 0000000..1dccbf9
--- /dev/null
+++ b/src/err.h
@@ -0,0 +1,17 @@
+#ifndef _ERR_H_
+#define _ERR_H_
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+static inline void error(const char *format, ...)
+{
+ va_list args;
+ va_start(args, format);
+ vfprintf(stderr, format, args);
+ va_end(args);
+ exit(1);
+}
+
+#endif