]>
Commit | Line | Data |
---|---|---|
7e9a36b6 JF |
1 | #include <objc/objc.h> |
2 | ||
dfaac1da JF |
3 | #include <sys/time.h> |
4 | #include <time.h> | |
5 | ||
7a5040cc JF |
6 | #define _forever \ |
7 | for (;;) | |
8 | ||
dfaac1da JF |
9 | #define _trace() do { \ |
10 | struct timeval _tv; \ | |
11 | gettimeofday(&_tv, NULL); \ | |
12 | fprintf(stderr, "%lu.%.6u:_trace()@%s:%u[%s]\n", _tv.tv_sec, _tv.tv_usec, __FILE__, __LINE__, __FUNCTION__); \ | |
13 | } while (false) | |
7e9a36b6 JF |
14 | |
15 | #define _assert(test) do \ | |
16 | if (!(test)) { \ | |
17 | fprintf(stderr, "_assert(%d:%s)@%s:%u[%s]\n", errno, #test, __FILE__, __LINE__, __FUNCTION__); \ | |
18 | exit(-1); \ | |
19 | } \ | |
20 | while (false) | |
21 | ||
22 | #define _not(type) ((type) ~ (type) 0) | |
23 | ||
24 | #define _transient | |
ae5602da JF |
25 | |
26 | #define _label__(x) _label ## x | |
27 | #define _label_(y) _label__(y) | |
28 | #define _label _label_(__LINE__) | |
a30c20bd JF |
29 | |
30 | #define _packed \ | |
31 | __attribute__((packed)) |