aboutsummaryrefslogtreecommitdiffstats
path: root/util.h
blob: 9ed7cd964694e5897f18d6ca80bd329efebd14aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef UTIL_H
#define UTIL_H

void error_exit(char *fmt, ...);

#define ERROR_EXIT(fmt, x...)					\
	do {							\
		error_exit(fmt, ## x);				\
	} while (0)

#define ERROR_EXIT_ON(check, fmt, x...)				\
	do {							\
		if (check)					\
			error_exit(fmt, ## x);			\
	} while (0)

#define ARRAY_SIZE(x) (sizeof(x)/sizeof(*(x)))

#endif