From 87d188b46c1cf0b9e5892969661990948de6a732 Mon Sep 17 00:00:00 2001 From: Peter Meerwald Date: Sun, 9 Nov 2014 17:28:36 +0100 Subject: [PATCH] macro: Add macro PA_UNUSED the macro PA_UNUSED may be used to suppress a warning when a variable is not used, or assigned and never used; this typically happens when the only use of the variable is within an assert() that can be optimized away (i.e. with NDEBUG set) has an effect with GCC only v2: (thanks to Alexander Patrakov) * fix patch subject/description Signed-off-by: Peter Meerwald --- src/pulsecore/macro.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pulsecore/macro.h b/src/pulsecore/macro.h index e36b6ce82..21c3e6c62 100644 --- a/src/pulsecore/macro.h +++ b/src/pulsecore/macro.h @@ -77,6 +77,12 @@ static inline size_t PA_PAGE_ALIGN(size_t l) { return (l + PA_PAGE_SIZE - 1) & ~(PA_PAGE_SIZE - 1); } +#if defined(__GNUC__) + #define PA_UNUSED __attribute__ ((unused)) +#else + #define PA_UNUSED +#endif + #define PA_ELEMENTSOF(x) (sizeof(x)/sizeof((x)[0])) #if defined(__GNUC__)