summaryrefslogtreecommitdiff
path: root/macros.h
blob: 8b8267ac13c910dcb5d0ec2741076e86a455a2e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#ifndef MACROS_H
#define MACROS_H

#define log(priority, ...) syslog(priority, __VA_ARGS__)

#define did_fail(cond, ...) {\
	if (cond) {\
		log(LOG_ERR, __VA_ARGS__); \
		return -1; \
	}\
}

#define did_fail_reason(cond, msg, ...) did_fail(cond, msg " Reason: %s", __VA_ARGS__)
#endif