Go to the documentation of this file. 1 #ifndef foopulsegccmacrohfoo
2 #define foopulsegccmacrohfoo
29 #define PA_GCC_PRINTF_ATTR(a,b) __attribute__ ((format (__MINGW_PRINTF_FORMAT, a, b)))
31 #define PA_GCC_PRINTF_ATTR(a,b) __attribute__ ((format (printf, a, b)))
35 #define PA_GCC_PRINTF_ATTR(a,b)
38 #if defined(__GNUC__) && (__GNUC__ >= 4)
39 #define PA_GCC_SENTINEL __attribute__ ((sentinel))
42 #define PA_GCC_SENTINEL
46 #define PA_GCC_NORETURN __attribute__((noreturn))
49 #define PA_GCC_NORETURN
53 #define PA_GCC_UNUSED __attribute__ ((unused))
60 #define PA_GCC_DESTRUCTOR __attribute__ ((destructor))
63 #define PA_GCC_DESTRUCTOR
68 #define PA_GCC_PURE __attribute__ ((pure))
77 #define PA_GCC_CONST __attribute__ ((const))
84 #ifndef PA_GCC_DEPRECATED
86 #define PA_GCC_DEPRECATED __attribute__ ((deprecated))
89 #define PA_GCC_DEPRECATED
95 #define PA_GCC_PACKED __attribute__ ((packed))
102 #ifndef PA_GCC_ALLOC_SIZE
103 #if defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 3)
104 #define PA_GCC_ALLOC_SIZE(x) __attribute__ ((__alloc_size__(x)))
105 #define PA_GCC_ALLOC_SIZE2(x,y) __attribute__ ((__alloc_size__(x,y)))
108 #define PA_GCC_ALLOC_SIZE(x)
110 #define PA_GCC_ALLOC_SIZE2(x,y)
114 #ifndef PA_GCC_MALLOC
116 #define PA_GCC_MALLOC __attribute__ ((malloc))
119 #define PA_GCC_MALLOC
123 #ifndef PA_GCC_WEAKREF
124 #if defined(__GNUC__) && defined(__ELF__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ > 1)) || (__GNUC__ > 4))
126 #define PA_GCC_WEAKREF(x) __attribute__((weakref(#x)))
132 #define PA_LIKELY(x) (__builtin_expect(!!(x),1))
133 #define PA_UNLIKELY(x) (__builtin_expect(!!(x),0))
135 #define PA_LIKELY(x) (x)
136 #define PA_UNLIKELY(x) (x)
141 #define PA_CLAMP(x, low, high) \
143 typeof(x) _x = (x); \
144 typeof(low) _low = (low); \
145 typeof(high) _high = (high); \
146 ((_x > _high) ? _high : ((_x < _low) ? _low : _x)); \
149 #define PA_CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
153 #define PA_CLAMP_UNLIKELY(x, low, high) \
155 typeof(x) _x = (x); \
156 typeof(low) _low = (low); \
157 typeof(high) _high = (high); \
158 (PA_UNLIKELY(_x > _high) ? _high : (PA_UNLIKELY(_x < _low) ? _low : _x)); \
161 #define PA_CLAMP_UNLIKELY(x, low, high) (PA_UNLIKELY((x) > (high)) ? (high) : (PA_UNLIKELY((x) < (low)) ? (low) : (x)))