X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=gcc-compat.h;h=ba1d82ead77ac6ae937a15a4e691ba8afc2f21b2;hp=f649c1d44b31f1f5d6197c41ecad1b4d57a56222;hb=e65bdaa6b207d5cd409acaa5d0d33fe85dd7a28d;hpb=e0e5a7c1a04c6a2ee4a475e823657e06e6df2f99 diff --git a/gcc-compat.h b/gcc-compat.h index f649c1d4..ba1d82ea 100644 --- a/gcc-compat.h +++ b/gcc-compat.h @@ -1,17 +1,15 @@ -#if __GNUC__ >= 3 -# define inline inline __attribute__ ((always_inline)) -# define __noreturn __attribute__ ((noreturn)) -# define __malloc __attribute__ ((malloc)) -# define __used __attribute__ ((used)) -# define __a_unused __attribute__ ((unused)) -# define __packed __attribute__ ((packed)) -# define likely(x) __builtin_expect (!!(x), 1) -# define unlikely(x) __builtin_expect (!!(x), 0) -/* - * p is the number of the "format string" parameter, and q is - * the number of the first variadic parameter +#define inline inline __attribute__ ((always_inline)) +#define __noreturn __attribute__ ((noreturn)) +#define __malloc __attribute__ ((malloc)) +#define __a_unused __attribute__ ((unused)) +#define __a_aligned(alignment) __attribute__((__aligned__(alignment))) + +/* + * p is the number of the "format string" parameter, and q is + * the number of the first variadic parameter. */ # define __printf(p,q) __attribute__ ((format (printf, p, q))) +# define __a_const __attribute__ ((const)) /* * as direct use of __printf(p,q) confuses doxygen, here are two extra macros * for those values p,q that are actually used by paraslash. @@ -19,23 +17,11 @@ #define __printf_1_2 __printf(1,2) #define __printf_2_3 __printf(2,3) -#else - -# define inline /* no inline */ -# define __noreturn /* no noreturn */ -# define __malloc /* no malloc */ -# define __used /* no used */ -# define __a__unused /* no unused */ -# define __packed /* no packed */ -# define likely(x) (x) -# define unlikely(x) (x) -# define __printf(p,q) /* no format */ -#define __printf_1_2 -#define __printf_2_3 -#endif - -# if __GNUC__ >=3 && __GNUC_MINOR__ > 3 +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3) # define __must_check __attribute__ ((warn_unused_result)) # else # define __must_check /* no warn_unused_result */ # endif + +#define _static_inline_ static inline +