… | |
… | |
13 | |
13 | |
14 | #define HAVE_GCC_BUILTINS (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ == 4)) |
14 | #define HAVE_GCC_BUILTINS (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ == 4)) |
15 | |
15 | |
16 | #if __GNUC__ >= 4 |
16 | #if __GNUC__ >= 4 |
17 | # define rxvt_attribute(x) __attribute__(x) |
17 | # define rxvt_attribute(x) __attribute__(x) |
|
|
18 | # define expect(expr,value) __builtin_expect ((expr),(value)) |
18 | #else |
19 | #else |
19 | # define rxvt_attribute(x) |
20 | # define rxvt_attribute(x) |
|
|
21 | # define expect(expr,value) (expr) |
20 | #endif |
22 | #endif |
|
|
23 | |
|
|
24 | // put into ifs if you are very sure that the expression |
|
|
25 | // is mostly true or mosty false. note that these return |
|
|
26 | // booleans, not the expression. |
|
|
27 | #define expect_false(expr) expect ((expr) != 0, 0) |
|
|
28 | #define expect_true(expr) expect ((expr) != 0, 1) |
21 | |
29 | |
22 | #define NORETURN rxvt_attribute ((noreturn)) |
30 | #define NORETURN rxvt_attribute ((noreturn)) |
23 | #define UNUSED rxvt_attribute ((unused)) |
31 | #define UNUSED rxvt_attribute ((unused)) |
24 | #define CONST rxvt_attribute ((const)) |
32 | #define CONST rxvt_attribute ((const)) |
25 | |
33 | |