40 lines
1.3 KiB
Diff
40 lines
1.3 KiB
Diff
From 6614b332854b172805467c0c02474e9f3210d0e4 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 033/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 a5d2623..3e31c80 100644
|
|
--- a/Python/getcompiler.c
|
|
+++ b/Python/getcompiler.c
|
|
@@ -10,7 +10,22 @@
|
|
#if defined(__clang__)
|
|
#define COMPILER "[Clang " __clang_version__ "]"
|
|
#elif defined(__GNUC__)
|
|
-#define COMPILER "[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++]"
|