From 14a63a81f6dfed3390dfef8f3cb0a173524f24f0 Mon Sep 17 00:00:00 2001 From: David Cournapeau Date: Fri, 19 Dec 2008 09:55:16 +0000 Subject: Add MS_WIN64 macro when built on amd64 + mingw. --- numpy/distutils/command/build_ext.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'numpy/distutils/command') diff --git a/numpy/distutils/command/build_ext.py b/numpy/distutils/command/build_ext.py index 3092167c6..5ad8c7fef 100644 --- a/numpy/distutils/command/build_ext.py +++ b/numpy/distutils/command/build_ext.py @@ -278,6 +278,14 @@ class build_ext (old_build_ext): 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 -- cgit v1.2.1 From 233e28b73eb02b7db5fbc573ac2a058f98b8e416 Mon Sep 17 00:00:00 2001 From: David Cournapeau Date: Fri, 19 Dec 2008 09:57:06 +0000 Subject: Forgot to import get_build_architecture. --- numpy/distutils/command/build_ext.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/distutils/command') diff --git a/numpy/distutils/command/build_ext.py b/numpy/distutils/command/build_ext.py index 5ad8c7fef..66bec3ac1 100644 --- a/numpy/distutils/command/build_ext.py +++ b/numpy/distutils/command/build_ext.py @@ -16,7 +16,7 @@ from numpy.distutils.exec_command import exec_command from numpy.distutils.system_info import combine_paths from numpy.distutils.misc_util import filter_sources, has_f_sources, \ has_cxx_sources, get_ext_source_files, \ - get_numpy_include_dirs, is_sequence + get_numpy_include_dirs, is_sequence, get_build_architecture from numpy.distutils.command.config_compiler import show_fortran_compilers try: -- cgit v1.2.1 From a7bf18812f143bc6926c1c21fcda25ef4ea1d26e Mon Sep 17 00:00:00 2001 From: David Cournapeau Date: Fri, 19 Dec 2008 09:57:52 +0000 Subject: Use a tuple when defining the MS_WIN64 macro. --- numpy/distutils/command/build_ext.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/distutils/command') diff --git a/numpy/distutils/command/build_ext.py b/numpy/distutils/command/build_ext.py index 66bec3ac1..2945d1ff5 100644 --- a/numpy/distutils/command/build_ext.py +++ b/numpy/distutils/command/build_ext.py @@ -284,7 +284,7 @@ class build_ext (old_build_ext): # Py_ModuleInit4_64, etc... So we add it here if self.compiler.compiler_type == 'mingw32' and \ get_build_architecture() == 'AMD64': - macros.append('MS_WIN64') + macros.append(('MS_WIN64',)) # Set Fortran/C++ compilers for compilation and linking. if ext.language=='f90': -- cgit v1.2.1 From 45d2c14ee19a23866ef44d4befe9058593c4e15d Mon Sep 17 00:00:00 2001 From: David Cournapeau Date: Fri, 19 Dec 2008 10:05:03 +0000 Subject: Fix macro def. --- numpy/distutils/command/build_ext.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/distutils/command') diff --git a/numpy/distutils/command/build_ext.py b/numpy/distutils/command/build_ext.py index 2945d1ff5..8d26718d0 100644 --- a/numpy/distutils/command/build_ext.py +++ b/numpy/distutils/command/build_ext.py @@ -284,7 +284,7 @@ class build_ext (old_build_ext): # Py_ModuleInit4_64, etc... So we add it here if self.compiler.compiler_type == 'mingw32' and \ get_build_architecture() == 'AMD64': - macros.append(('MS_WIN64',)) + macros.append(('MS_WIN64', None)) # Set Fortran/C++ compilers for compilation and linking. if ext.language=='f90': -- cgit v1.2.1 From f531cfb60fd0e4dec69354bfd61109defa99ea5e Mon Sep 17 00:00:00 2001 From: David Cournapeau Date: Sat, 20 Dec 2008 17:32:33 +0000 Subject: Remove handling of MS_WIN64 in commands: deal with it in mingw tool only. --- numpy/distutils/command/build_ext.py | 8 -------- 1 file changed, 8 deletions(-) (limited to 'numpy/distutils/command') diff --git a/numpy/distutils/command/build_ext.py b/numpy/distutils/command/build_ext.py index 8d26718d0..904cb9067 100644 --- a/numpy/distutils/command/build_ext.py +++ b/numpy/distutils/command/build_ext.py @@ -278,14 +278,6 @@ class build_ext (old_build_ext): 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', None)) - # Set Fortran/C++ compilers for compilation and linking. if ext.language=='f90': fcompiler = self._f90_compiler -- cgit v1.2.1