[xiph-commits] r3199 - liboggz/trunk/src/liboggz

erikd at svn.annodex.net erikd at svn.annodex.net
Tue Aug 21 15:52:32 PDT 2007


Author: erikd
Date: 2007-08-21 15:52:32 -0700 (Tue, 21 Aug 2007)
New Revision: 3199

Modified:
   liboggz/trunk/src/liboggz/oggz_macros.h
Log:
oggz_macros.h : Add UNUSED and WARN_UNUSED macros.

Modified: liboggz/trunk/src/liboggz/oggz_macros.h
===================================================================
--- liboggz/trunk/src/liboggz/oggz_macros.h	2007-08-21 22:10:06 UTC (rev 3198)
+++ liboggz/trunk/src/liboggz/oggz_macros.h	2007-08-21 22:52:32 UTC (rev 3199)
@@ -47,4 +47,22 @@
 #undef MAX
 #define MAX(a,b) ((a)>(b)?(a):(b))
 
+/*
+** 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
+#       define WARN_UNUSED
+#endif
+
 #endif /* __OGGZ_MACROS_H__ */



More information about the commits mailing list