Skip to content

Commit 5ab35cc

Browse files
jeremyd2019naveen521kk
authored andcommitted
clang arm64
Co-authored-by: Naveen M K <[email protected]>
1 parent ec3cd5e commit 5ab35cc

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Python/getcompiler.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
// Note the __clang__ conditional has to come before the __GNUC__ one because
99
// clang pretends to be GCC.
10-
#if defined(__clang__)
10+
#if defined(__clang__) && !defined(_WIN32)
1111
#define COMPILER "[Clang " __clang_version__ "]"
1212
#elif defined(__GNUC__)
1313
/* To not break compatibility with things that determine
@@ -18,14 +18,23 @@
1818
#define COMP_SEP " "
1919
#if defined(__x86_64__)
2020
#define ARCH_SUFFIX " 64 bit (AMD64)"
21+
#elif defined(__aarch64__)
22+
#define ARCH_SUFFIX " 64 bit (ARM64)"
2123
#else
2224
#define ARCH_SUFFIX " 32 bit"
2325
#endif
2426
#else
2527
#define COMP_SEP "\n"
2628
#define ARCH_SUFFIX ""
2729
#endif
30+
#if defined(__clang__)
31+
#define str(x) #x
32+
#define xstr(x) str(x)
33+
#define COMPILER COMP_SEP "[GCC Clang " xstr(__clang_major__) "." \
34+
xstr(__clang_minor__) "." xstr(__clang_patchlevel__) ARCH_SUFFIX "]"
35+
#else
2836
#define COMPILER COMP_SEP "[GCC " __VERSION__ ARCH_SUFFIX "]"
37+
#endif
2938
// Generic fallbacks.
3039
#elif defined(__cplusplus)
3140
#define COMPILER "[C++]"

0 commit comments

Comments
 (0)