Skip to content

Commit f74deea

Browse files
Alexpuxlazka
authored andcommitted
Add AMD64 to sys config so msvccompiler get_build_version works
1 parent 7af446f commit f74deea

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

Python/getcompiler.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,22 @@
1010
#if defined(__clang__)
1111
#define COMPILER "[Clang " __clang_version__ "]"
1212
#elif defined(__GNUC__)
13-
#define COMPILER "[GCC " __VERSION__ "]"
13+
/* To not break compatibility with things that determine
14+
CPU arch by calling get_build_version in msvccompiler.py
15+
(such as NumPy) add "32 bit" or "64 bit (AMD64)" on Windows
16+
and also use a space as a separator rather than a newline. */
17+
#if defined(_WIN32)
18+
#define COMP_SEP " "
19+
#if defined(__x86_64__)
20+
#define ARCH_SUFFIX " 64 bit (AMD64)"
21+
#else
22+
#define ARCH_SUFFIX " 32 bit"
23+
#endif
24+
#else
25+
#define COMP_SEP "\n"
26+
#define ARCH_SUFFIX ""
27+
#endif
28+
#define COMPILER COMP_SEP "[GCC " __VERSION__ ARCH_SUFFIX "]"
1429
// Generic fallbacks.
1530
#elif defined(__cplusplus)
1631
#define COMPILER "[C++]"

0 commit comments

Comments
 (0)