summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Meerwald <pmeerw@pmeerw.net>2014-11-09 17:28:36 +0100
committerPeter Meerwald <p.meerwald@bct-electronic.com>2014-11-17 13:24:43 +0100
commit87d188b46c1cf0b9e5892969661990948de6a732 (patch)
tree08d7975df1925b161f9c0beaed72bbabccf08555
parent094de7f02404c8eaed75dfccc4d2febd7d64484a (diff)
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 <pmeerw@pmeerw.net>
-rw-r--r--src/pulsecore/macro.h6
1 files changed, 6 insertions, 0 deletions
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__)