MINGW-packages/mingw-w64-python2/0970-Add-AMD64-to-sys-config-so-msvccompiler-get_build_version-works.patch
Ray Donnelly 51ca502b53 python2 + 3 + numpy: Various updates and fixes
* Update python2 to 2.7.11
* Update numpy to 1.10.2 (and number the patches).
* New python2 + 3 patch so that sys.version returns
  something more similar to normal CPython so that
  get_build_architecture in distutils msvccompiler.py
  returns the right thing (NumPy uses it so there's
  every chance other things will too).
2016-01-02 21:45:58 +00:00

27 lines
814 B
Diff

--- Python-2.7.10/Python/getcompiler.c.orig 2015-05-23 17:09:24.000000000 +0100
+++ Python-2.7.10/Python/getcompiler.c 2016-01-02 17:10:40.399949300 +0000
@@ -6,7 +6,22 @@
#ifndef COMPILER
#ifdef __GNUC__
-#define COMPILER "\n[GCC " __VERSION__ "]"
+/* To not break compatibility with things that determine
+ CPU arch by calling get_build_version in msvccompiler.py
+ (such as NumPy) add "32 bit" or "64 bit (AMD64)" on Windows
+ and also use a space as a separator rather than a newline. */
+#if defined(_WIN32)
+#define COMP_SEP " "
+#if defined(__x86_64__)
+#define ARCH_SUFFIX " 64 bit (AMD64)"
+#else
+#define ARCH_SUFFIX " 32 bit"
+#endif
+#else
+#define COMP_SEP "\n"
+#define ARCH_SUFFIX ""
+#endif
+#define COMPILER COMP_SEP "[GCC " __VERSION__ ARCH_SUFFIX "]"
#endif
#endif /* !COMPILER */