File: bug.h

package info (click to toggle)
tinyssh 20250501-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,388 kB
  • sloc: ansic: 20,245; sh: 1,582; python: 1,449; makefile: 913
file content (48 lines) | stat: -rw-r--r-- 2,539 bytes parent folder | download | duplicates (2)
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