5fea55d5cec035b1e504f0ac928e1f9cdcd463ff
[paraslash.git] / gcc-compat.h
1 # define inline inline __attribute__ ((always_inline))
2 # define __noreturn __attribute__ ((noreturn))
3 # define __malloc __attribute__ ((malloc))
4 # define __used __attribute__ ((used))
5 # define __a_unused __attribute__ ((unused))
6 # define __packed __attribute__ ((packed))
7 # define likely(x) __builtin_expect (!!(x), 1)
8 # define unlikely(x) __builtin_expect (!!(x), 0)
9 /*
10 * p is the number of the "format string" parameter, and q is
11 * the number of the first variadic parameter
12 */
13 # define __printf(p,q) __attribute__ ((format (printf, p, q)))
14 /*
15 * as direct use of __printf(p,q) confuses doxygen, here are two extra macros
16 * for those values p,q that are actually used by paraslash.
17 */
18 #define __printf_1_2 __printf(1,2)
19 #define __printf_2_3 __printf(2,3)
20
21 # if __GNUC__ >=3 && __GNUC_MINOR__ > 3
22 # define __must_check __attribute__ ((warn_unused_result))
23 # else
24 # define __must_check /* no warn_unused_result */
25 # endif
26
27 #define _static_inline_ static inline