-
Notifications
You must be signed in to change notification settings - Fork 79
/
bug.h
48 lines (43 loc) · 2.48 KB
/
bug.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef BUG_H____
#define BUG_H____
#include <unistd.h>
#include "global.h"
#include "e.h"
#include "log.h"
#define bug_(a, b) \
do { \
log_9_(-1, 0, a, b, 0, 0, 0, 0, 0, 0, 0, 0, 0); \
global_die(111); \
} while (0)
#define bug() bug_(__FILE__, __LINE__)
#define bug_nomem() \
do { \
errno = ENOMEM; \
bug(); \
} while (0)
#define bug_proto() \
do { \
errno = EPROTO; \
bug(); \
} while (0)
#define bug_inval() \
do { \
errno = EINVAL; \
bug(); \
} while (0)
#define bug_nomem_(a, b) \
do { \
errno = ENOMEM; \
bug_(a, b); \
} while (0)
#define bug_proto_(a, b) \
do { \
errno = EPROTO; \
bug_(a, b); \
} while (0)
#define bug_inval_(a, b) \
do { \
errno = EINVAL; \
bug_(a, b); \
} while (0)
#endif