diff options
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -0,0 +1,17 @@ +#ifndef UTIL_H +#define UTIL_H + +#include <stdio.h> // fprintf() +#include <stdlib.h> // exit() + +#define MAX(a, b) ((a) > (b) ? (a) : (b)) +#define UNUSED(a) ((void) (a)) + +#define die(...) do { \ + fputs("FATAL: ", stderr); \ + fprintf(stderr, __VA_ARGS__); \ + fputs("\n", stderr); \ + exit(EXIT_FAILURE); \ +} while (0) + +#endif /* UTIL_H */ |