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

numpy-svn@scip... numpy-svn@scip...
Sun Aug 3 04:35:25 CDT 2008


Author: cdavid
Date: 2008-08-03 04:35:15 -0500 (Sun, 03 Aug 2008)
New Revision: 5596

Modified:
   trunk/numpy/core/include/numpy/ndarrayobject.h
Log:
Use inttypes format if available for NPY_INTP.


Modified: trunk/numpy/core/include/numpy/ndarrayobject.h
===================================================================
--- trunk/numpy/core/include/numpy/ndarrayobject.h	2008-08-02 08:29:20 UTC (rev 5595)
+++ trunk/numpy/core/include/numpy/ndarrayobject.h	2008-08-03 09:35:15 UTC (rev 5596)
@@ -971,6 +971,22 @@
         #define NPY_INTP_FMT "Ld"
 #endif
 
+/* If available, use formats in inttypes for (u)intp types. */
+#ifdef HAVE_UINTPTR_T /* set in pyconfig.h */
+        #ifdef HAVE_INTTYPES_H /* set in pyconfig.h */
+                #include <inttypes.h>
+
+                #undef NPY_MAX_INTP
+                #undef NPY_MIN_INTP
+                #undef NPY_MAX_UINTP
+                #undef NPY_INTP_FMT
+                #define NPY_MAX_INTP INTPTR_MAX
+                #define NPY_MIN_INTP INTPTR_MIN
+                #define NPY_MAX_UINTP UINTPTR_MAX
+                #define NPY_INTP_FMT PRIdPTR
+        #endif
+#endif
+
 #define NPY_ERR(str) fprintf(stderr, #str); fflush(stderr);
 #define NPY_ERR2(str) fprintf(stderr, str); fflush(stderr);
 



More information about the Numpy-svn mailing list