summaryrefslogtreecommitdiff
path: root/src/util/util.h
blob: 9dd5a335677ea4e099cba90048902441c0858db7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#ifndef UTIL_H
#define UTIL_H

#define ARRAY_LEN(first, ...) \
	(sizeof(((typeof(first) []){first, __VA_ARGS__}))/(sizeof(typeof(first))))

#define bool_equal(a,b) ({	\
	typeof(a) _a = (a);	\
	typeof(b) _b = (b);	\
	((_a) ? (_b) : (!(_b)));	\
})

#endif