aboutsummaryrefslogtreecommitdiff
path: root/util.h
blob: d13dfae16f824bb6ea8a6ad8a0a0451f8bb33188 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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 */