[Numpy-svn] r5614 - in trunk/numpy/core: . include/numpy

numpy-svn@scip... numpy-svn@scip...
Tue Aug 5 19:11:28 CDT 2008


Author: cdavid
Date: 2008-08-05 19:11:22 -0500 (Tue, 05 Aug 2008)
New Revision: 5614

Modified:
   trunk/numpy/core/include/numpy/numpyconfig.h.in
   trunk/numpy/core/setup.py
Log:
Always define __STDC_FORMAT_MACROS for C++ support of PRIdPTR.

Modified: trunk/numpy/core/include/numpy/numpyconfig.h.in
===================================================================
--- trunk/numpy/core/include/numpy/numpyconfig.h.in	2008-08-05 23:21:31 UTC (rev 5613)
+++ trunk/numpy/core/include/numpy/numpyconfig.h.in	2008-08-06 00:11:22 UTC (rev 5614)
@@ -16,3 +16,9 @@
 @DEFINE_NPY_SIZEOF_PY_LONG_LONG@
 
 #define NPY_USE_C99_FORMATS @USE_C99_FORMATS@
+
+/* Ugly, but we can't test this in a proper manner without requiring a C++
+ * compiler at the configuration stage of numpy ? */
+#ifndef __STDC_FORMAT_MACROS
+	#define __STDC_FORMAT_MACROS 1
+#endif

Modified: trunk/numpy/core/setup.py
===================================================================
--- trunk/numpy/core/setup.py	2008-08-05 23:21:31 UTC (rev 5613)
+++ trunk/numpy/core/setup.py	2008-08-06 00:11:22 UTC (rev 5614)
@@ -204,6 +204,13 @@
                     target_f.write('#define %s\n' % (d))
                 else:
                     target_f.write('#define %s %s\n' % (d[0],d[1]))
+
+            # Define __STDC_FORMAT_MACROS
+            target_f.write("""
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
+""")
             target_f.close()
 
             # Dump the numpyconfig.h header to stdout



More information about the Numpy-svn mailing list