summaryrefslogtreecommitdiff
path: root/Cython/Utility/ModuleSetupCode.c
diff options
context:
space:
mode:
authorJeroen Demeyer <jdemeyer@cage.ugent.be>2016-10-26 23:32:49 +0200
committerJeroen Demeyer <jdemeyer@cage.ugent.be>2016-10-26 23:32:49 +0200
commit3ca0b91c08fb1e7263a257a6e4dd8c27d37709b5 (patch)
treec4c0643f081d1804289434d98c8f4de35e8d2a24 /Cython/Utility/ModuleSetupCode.c
parentbd4889fe5ab320368d408c433e158c71222158a9 (diff)
downloadcython-3ca0b91c08fb1e7263a257a6e4dd8c27d37709b5.tar.gz
Move CYTHON_UNUSED macro up such that included files can use it
Diffstat (limited to 'Cython/Utility/ModuleSetupCode.c')
-rw-r--r--Cython/Utility/ModuleSetupCode.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c
index a5aeb9514..a35489645 100644
--- a/Cython/Utility/ModuleSetupCode.c
+++ b/Cython/Utility/ModuleSetupCode.c
@@ -384,6 +384,29 @@
#endif
#endif
+// unused attribute
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+
+#ifndef CYTHON_NCP_UNUSED
+# if CYTHON_COMPILING_IN_CPYTHON
+# define CYTHON_NCP_UNUSED
+# else
+# define CYTHON_NCP_UNUSED CYTHON_UNUSED
+# endif
+#endif
+
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
@@ -467,29 +490,6 @@ static CYTHON_INLINE float __PYX_NAN() {
/////////////// UtilityFunctionPredeclarations.proto ///////////////
-/* unused attribute */
-#ifndef CYTHON_UNUSED
-# if defined(__GNUC__)
-# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-# define CYTHON_UNUSED __attribute__ ((__unused__))
-# else
-# define CYTHON_UNUSED
-# endif
-# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
-# define CYTHON_UNUSED __attribute__ ((__unused__))
-# else
-# define CYTHON_UNUSED
-# endif
-#endif
-
-#ifndef CYTHON_NCP_UNUSED
-# if CYTHON_COMPILING_IN_CPYTHON
-# define CYTHON_NCP_UNUSED
-# else
-# define CYTHON_NCP_UNUSED CYTHON_UNUSED
-# endif
-#endif
-
typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/