summaryrefslogtreecommitdiff
path: root/Cython/Compiler/ModuleNode.py
diff options
context:
space:
mode:
authorRobert Bradshaw <robertwb@gmail.com>2018-10-24 01:17:06 +0200
committerRobert Bradshaw <robertwb@gmail.com>2018-10-24 01:17:06 +0200
commit55861ed7698382af7799013466cfbb2bae08b97d (patch)
tree2defea082092a28a35db206cebc1fc52d6ed627a /Cython/Compiler/ModuleNode.py
parent443369fc35ac35525eb4241548cad79d0c94f8dc (diff)
downloadcython-55861ed7698382af7799013466cfbb2bae08b97d.tar.gz
Workaround for long internals misconfiguration on 64-bit MinGW.
Also add a compile time check for SIZEOF_VOID_P. This fixes #2670. See also https://bugs.python.org/issue35037 https://bugs.python.org/issue4709
Diffstat (limited to 'Cython/Compiler/ModuleNode.py')
-rw-r--r--Cython/Compiler/ModuleNode.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py
index d4eaf20ab..ce1a94289 100644
--- a/Cython/Compiler/ModuleNode.py
+++ b/Cython/Compiler/ModuleNode.py
@@ -246,6 +246,11 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
h_code.put_generated_by()
api_guard = Naming.api_guard_prefix + self.api_name(env)
h_code.put_h_guard(api_guard)
+ # Work around https://bugs.python.org/issue4709
+ h_code.putln('#ifdef __MINGW64__')
+ h_code.putln('#define MS_WIN64')
+ h_code.putln('#endif')
+
h_code.putln('#include "Python.h"')
if result.h_file:
h_code.putln('#include "%s"' % os.path.basename(result.h_file))