blob: b9981c9427c5fc5dcaa01d1e48ab299626dcd7db [file] [log] [blame]
From 1c81c81b5e7f5ba55927e8ae64e148731ed9b04f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?=
<alexey.pawlow@gmail.com>
Date: Thu, 17 Jun 2021 18:52:07 +0530
Subject: [PATCH 065/N] Add AMD64 to sys config so msvccompiler
get_build_version works
---
Python/getcompiler.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/Python/getcompiler.c b/Python/getcompiler.c
index 59c0dbf..adccaa7 100644
--- a/Python/getcompiler.c
+++ b/Python/getcompiler.c
@@ -10,7 +10,22 @@
#if defined(__clang__)
#define COMPILER "\n[Clang " __clang_version__ "]"
#elif defined(__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 "]"
// Generic fallbacks.
#elif defined(__cplusplus)
#define COMPILER "[C++]"
--
2.32.0