… | |
… | |
64 | |
64 | |
65 | #define ECB_HEADER_INLINE static ECB_INLINE |
65 | #define ECB_HEADER_INLINE static ECB_INLINE |
66 | |
66 | |
67 | #if ECB_GCC_VERSION(3,1) |
67 | #if ECB_GCC_VERSION(3,1) |
68 | # define ecb_attribute(attrlist) __attribute__(attrlist) |
68 | # define ecb_attribute(attrlist) __attribute__(attrlist) |
69 | # define ecb_is_constant(c) __builtin_constant_p (c) |
69 | # define ecb_is_constant(expr) __builtin_constant_p (expr) |
70 | # define ecb_expect(expr,value) __builtin_expect ((expr),(value)) |
70 | # define ecb_expect(expr,value) __builtin_expect ((expr),(value)) |
71 | # define ecb_prefetch(addr,rw,locality) __builtin_prefetch (addr, rw, locality) |
71 | # define ecb_prefetch(addr,rw,locality) __builtin_prefetch (addr, rw, locality) |
72 | #else |
72 | #else |
73 | # define ecb_attribute(attrlist) |
73 | # define ecb_attribute(attrlist) |
74 | # define ecb_is_constant(c) 0 |
74 | # define ecb_is_constant(expr) 0 |
75 | # define ecb_expect(expr,value) (expr) |
75 | # define ecb_expect(expr,value) (expr) |
76 | # define ecb_prefetch(addr,rw,locality) |
76 | # define ecb_prefetch(addr,rw,locality) |
77 | #endif |
77 | #endif |
78 | |
78 | |
79 | /* no emulation for ecb_decltype */ |
79 | /* no emulation for ecb_decltype */ |
… | |
… | |
89 | #define ecb_const ecb_attribute ((const)) |
89 | #define ecb_const ecb_attribute ((const)) |
90 | #define ecb_pure ecb_attribute ((pure)) |
90 | #define ecb_pure ecb_attribute ((pure)) |
91 | #define ecb_hot ecb_attribute ((hot)) /* 4.3 */ |
91 | #define ecb_hot ecb_attribute ((hot)) /* 4.3 */ |
92 | #define ecb_cold ecb_attribute ((cold)) /* 4.3 */ |
92 | #define ecb_cold ecb_attribute ((cold)) /* 4.3 */ |
93 | |
93 | |
94 | /* put into ifs if you are very sure that the expression */ |
94 | /* put into if's if you are very sure that the expression */ |
95 | /* is mostly true or mosty false. note that these return */ |
95 | /* is mostly true or mosty false. note that these return */ |
96 | /* booleans, not the expression. */ |
96 | /* booleans, not the expression. */ |
97 | #define ecb_unlikely(expr) ecb_expect (!!(expr), 0) |
97 | #define ecb_unlikely(expr) ecb_expect (!!(expr), 0) |
98 | #define ecb_likely(expr) ecb_expect (!!(expr), 1) |
98 | #define ecb_likely(expr) ecb_expect (!!(expr), 1) |
99 | |
99 | |