diff options
author | katherine <ageha@airen-no-jikken.icu> | 2019-12-20 09:28:54 -0700 |
---|---|---|
committer | katherine <ageha@airen-no-jikken.icu> | 2019-12-20 09:28:54 -0700 |
commit | 41f73b0a45ba3e63ac33ebdc99f12481f5b7cdab (patch) | |
tree | cb863c4372a1386a27cd1e655afeeb160f396d46 /src/err.h | |
parent | 31632d4edbd903826cbf8f6bb93969f0d1a983fb (diff) | |
download | every-41f73b0a45ba3e63ac33ebdc99f12481f5b7cdab.tar.gz |
implement printing
Diffstat (limited to 'src/err.h')
-rw-r--r-- | src/err.h | 19 |
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 |