diff options
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 |