[Numpy-svn] r6167 - branches/numpy-mingw-w64/numpy/distutils/command

numpy-svn@scip... numpy-svn@scip...
Fri Dec 19 03:55:21 CST 2008


Author: cdavid
Date: 2008-12-19 03:55:16 -0600 (Fri, 19 Dec 2008)
New Revision: 6167

Modified:
   branches/numpy-mingw-w64/numpy/distutils/command/build_ext.py
Log:
Add MS_WIN64 macro when built on amd64 + mingw.

Modified: branches/numpy-mingw-w64/numpy/distutils/command/build_ext.py
===================================================================
--- branches/numpy-mingw-w64/numpy/distutils/command/build_ext.py	2008-12-19 09:48:01 UTC (rev 6166)
+++ branches/numpy-mingw-w64/numpy/distutils/command/build_ext.py	2008-12-19 09:55:16 UTC (rev 6167)
@@ -278,6 +278,14 @@
             c_sources += cxx_sources
             cxx_sources = []
 
+        # MS_WIN64 should be defined when building for amd64 on windows, but
+        # python headers define it only for MS compilers, which has all kind of
+        # bad consequences, like using Py_ModuleInit4 instead of
+        # Py_ModuleInit4_64, etc... So we add it here
+        if self.compiler.compiler_type == 'mingw32' and \
+           get_build_architecture() == 'AMD64':
+               macros.append('MS_WIN64')
+
         # Set Fortran/C++ compilers for compilation and linking.
         if ext.language=='f90':
             fcompiler = self._f90_compiler



More information about the Numpy-svn mailing list