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

numpy-svn at scipy.org numpy-svn at scipy.org
Fri Sep 22 22:47:31 CDT 2006


Author: oliphant
Date: 2006-09-22 22:47:27 -0500 (Fri, 22 Sep 2006)
New Revision: 3209

Modified:
   trunk/numpy/core/include/numpy/ndarrayobject.h
Log:
Fix the Python2.5-compatibility macros so that conflicts with other libraries are avoided.

Modified: trunk/numpy/core/include/numpy/ndarrayobject.h
===================================================================
--- trunk/numpy/core/include/numpy/ndarrayobject.h	2006-09-23 03:32:14 UTC (rev 3208)
+++ trunk/numpy/core/include/numpy/ndarrayobject.h	2006-09-23 03:47:27 UTC (rev 3209)
@@ -639,11 +639,18 @@
 #define NPY_SIZEOF_INTP SIZEOF_PY_INTPTR_T
 #define NPY_SIZEOF_UINTP SIZEOF_PY_INTPTR_T
 
+#ifdef constchar
+#undef constchar
+#endif
+
 #if (PY_VERSION_HEX < 0x02050000)
-typedef int Py_ssize_t;
-#define PY_SSIZE_T_MAX INT_MAX
-#define PY_SSIZE_T_MIN INT_MIN
+  #ifndef PY_SSIZE_T_MIN
+    typedef int Py_ssize_t;
+    #define PY_SSIZE_T_MAX INT_MAX
+    #define PY_SSIZE_T_MIN INT_MIN
+  #endif 
 #define NPY_SSIZE_T_PYFMT "i"
+#undef PyIndex_Check
 #define constchar const char
 #define PyIndex_Check(op) 0
 #else



More information about the Numpy-svn mailing list