aboutsummaryrefslogtreecommitdiff
path: root/src/text/util.h
blob: bb9138321609d9ab692710d27fe0ba00f9c32c12 (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()

#define warn(fmt, ...) do { \
  fprintf(stderr, "W: " fmt "\n", ##__VA_ARGS__); \
} while (0)

#define die(fmt, ...) do { \
  fprintf(stderr, "ERROR: " fmt "\n", ##__VA_ARGS__); \
  exit(EXIT_FAILURE); \
} while (0)

#define UNUSED(a) ((void) (a))

#endif /* UTIL_H */