[Numpy-svn] r5937 - trunk/numpy/core/include/numpy

numpy-svn@scip... numpy-svn@scip...
Wed Oct 8 08:33:48 CDT 2008


Author: cdavid
Date: 2008-10-08 08:33:34 -0500 (Wed, 08 Oct 2008)
New Revision: 5937

Added:
   trunk/numpy/core/include/numpy/utils.h
Log:
    Add utils.h, with macro to tag a variable as unused.


Added: trunk/numpy/core/include/numpy/utils.h
===================================================================
--- trunk/numpy/core/include/numpy/utils.h	2008-10-06 21:05:03 UTC (rev 5936)
+++ trunk/numpy/core/include/numpy/utils.h	2008-10-08 13:33:34 UTC (rev 5937)
@@ -0,0 +1,19 @@
+#ifndef __NUMPY_UTILS_HEADER__
+#define __NUMPY_UTILS_HEADER__
+
+#ifndef __COMP_NPY_UNUSED
+	#if defined(__GNUC__)
+		#define __COMP_NPY_UNUSED __attribute__ ((__unused__))
+	# elif defined(__ICC)
+		#define __COMP_NPY_UNUSED __attribute__ ((__unused__))
+	#else
+		#define __COMP_NPY_UNUSED
+	#endif
+#endif
+
+/* Use this to tag a variable as not used. It will remove unused variable
+ * warning on support platforms (see __COM_NPY_UNUSED) and mangle the variable
+ * to avoid accidental use */
+#define NPY_UNUSED(x) (__NPY_UNUSED_TAGGED ## x) __COMP_NPY_UNUSED
+
+#endif



More information about the Numpy-svn mailing list