shithub: libsamplerate

Download patch

ref: 3cd3dffeede0791cf584b229057563f8995dddb1
parent: 6707f5c0166c331e62c2c14f75ef6baf6d96b706
author: Erik de Castro Lopo <[email protected]>
date: Sun Nov 29 14:13:28 EST 2009

src/common.h : Add macro UNUSED for marking function parameters as unused.

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-29  Erik de Castro Lopo  <erikd AT mega-nerd DOT com>
+
+    * src/common.h
+    Add macro UNUSED for marking function parameters as unused.
+
 2009-10-07  Erik de Castro Lopo  <erikd AT mega-nerd DOT com>
 
     * tests/misc_test.c
--- a/src/common.h
+++ b/src/common.h
@@ -46,6 +46,18 @@
 
 #define	MAKE_MAGIC(a,b,c,d,e,f)	((a) + ((b) << 4) + ((c) << 8) + ((d) << 12) + ((e) << 16) + ((f) << 20))
 
+/*
+** Inspiration : http://sourcefrog.net/weblog/software/languages/C/unused.html
+*/
+#ifdef UNUSED
+#elif defined (__GNUC__)
+#	define UNUSED(x) UNUSED_ ## x __attribute__ ((unused))
+#elif defined (__LCLINT__)
+#	define UNUSED(x) /*@unused@*/ x
+#else
+#	define UNUSED(x) x
+#endif
+
 #ifdef __GNUC__
 #	define WARN_UNUSED	__attribute__ ((warn_unused_result))
 #else