diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2021-12-30 18:31:53 +0100 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2021-12-30 18:31:53 +0100 |
commit | ec14f2955222932bb68704cc4590ba1dbd165cd9 (patch) | |
tree | 7bc4e580170231af32305f65875bd3cb2d9d541c /common/err.h | |
parent | 4c52777ca9e52edd0bff76168d886de9757ea457 (diff) | |
download | uwu-lang-ec14f2955222932bb68704cc4590ba1dbd165cd9.tar.xz |
Allow passing arguments to program, refactor directory structure
Diffstat (limited to 'common/err.h')
-rw-r--r-- | common/err.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/common/err.h b/common/err.h new file mode 100644 index 0000000..1dccbf9 --- /dev/null +++ b/common/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 |