Go to the documentation of this file. 1#ifndef foopulsegccmacrohfoo
2#define foopulsegccmacrohfoo
31#define PA_GCC_PRINTF_ATTR(a,b) __attribute__ ((format (__printf__, a, b)))
33#define PA_GCC_PRINTF_ATTR(a,b) __attribute__ ((format (printf, a, b)))
37#define PA_GCC_PRINTF_ATTR(a,b)
40#if defined(__GNUC__) && (__GNUC__ >= 4)
41#define PA_GCC_SENTINEL __attribute__ ((sentinel))
44#define PA_GCC_SENTINEL
48#define PA_GCC_NORETURN __attribute__((noreturn))
51#define PA_GCC_NORETURN
55#define PA_GCC_UNUSED __attribute__ ((unused))
62#define PA_GCC_DESTRUCTOR __attribute__ ((destructor))
65#define PA_GCC_DESTRUCTOR
70#define PA_GCC_PURE __attribute__ ((pure))
79#define PA_GCC_CONST __attribute__ ((const))
86#ifndef PA_GCC_DEPRECATED
88#define PA_GCC_DEPRECATED __attribute__ ((deprecated))
91#define PA_GCC_DEPRECATED
97#define PA_GCC_PACKED __attribute__ ((packed))
104#ifndef PA_GCC_ALLOC_SIZE
105#if defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 3)
106#define PA_GCC_ALLOC_SIZE(x) __attribute__ ((__alloc_size__(x)))
107#define PA_GCC_ALLOC_SIZE2(x,y) __attribute__ ((__alloc_size__(x,y)))
110#define PA_GCC_ALLOC_SIZE(x)
112#define PA_GCC_ALLOC_SIZE2(x,y)
118#define PA_GCC_MALLOC __attribute__ ((malloc))
125#ifndef PA_GCC_WEAKREF
126#if defined(__GNUC__) && defined(__ELF__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ > 1)) || (__GNUC__ > 4))
128#define PA_GCC_WEAKREF(x) __attribute__((weakref(#x)))
134#define PA_LIKELY(x) (__builtin_expect(!!(x),1))
135#define PA_UNLIKELY(x) (__builtin_expect(!!(x),0))
137#define PA_LIKELY(x) (x)
138#define PA_UNLIKELY(x) (x)
143#define PA_CLAMP(x, low, high) \
145 typeof(x) _x = (x); \
146 typeof(low) _low = (low); \
147 typeof(high) _high = (high); \
148 ((_x > _high) ? _high : ((_x < _low) ? _low : _x)); \
151#define PA_CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
155#define PA_CLAMP_UNLIKELY(x, low, high) \
157 typeof(x) _x = (x); \
158 typeof(low) _low = (low); \
159 typeof(high) _high = (high); \
160 (PA_UNLIKELY(_x > _high) ? _high : (PA_UNLIKELY(_x < _low) ? _low : _x)); \
163#define PA_CLAMP_UNLIKELY(x, low, high) (PA_UNLIKELY((x) > (high)) ? (high) : (PA_UNLIKELY((x) < (low)) ? (low) : (x)))