From 852ade1e64a07991efc2d76c87cae3a51a9e3bf1 Mon Sep 17 00:00:00 2001
From: jeremyd2019 <4524874+jeremyd2019@users.noreply.github.com>
Date: Thu, 17 Jun 2021 18:52:36 +0530
Subject: [PATCH 048/N] clang arm64

Co-authored-by: Naveen M K <naveen521kk@gmail.com>
---
 Python/getcompiler.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/Python/getcompiler.c b/Python/getcompiler.c
index 3e31c80..7e7be71 100644
--- a/Python/getcompiler.c
+++ b/Python/getcompiler.c
@@ -7,7 +7,7 @@
 
 // Note the __clang__ conditional has to come before the __GNUC__ one because
 // clang pretends to be GCC.
-#if defined(__clang__)
+#if defined(__clang__) && !defined(_WIN32)
 #define COMPILER "[Clang " __clang_version__ "]"
 #elif defined(__GNUC__)
 /* To not break compatibility with things that determine
@@ -18,6 +18,8 @@
 #define COMP_SEP " "
 #if defined(__x86_64__)
 #define ARCH_SUFFIX " 64 bit (AMD64)"
+#elif defined(__aarch64__)
+#define ARCH_SUFFIX " 64 bit (ARM64)"
 #else
 #define ARCH_SUFFIX " 32 bit"
 #endif
@@ -25,7 +27,14 @@
 #define COMP_SEP "\n"
 #define ARCH_SUFFIX ""
 #endif
+#if defined(__clang__)
+#define str(x) #x
+#define xstr(x) str(x)
+#define COMPILER COMP_SEP "[GCC Clang " xstr(__clang_major__) "." \
+        xstr(__clang_minor__) "." xstr(__clang_patchlevel__) ARCH_SUFFIX "]"
+#else
 #define COMPILER COMP_SEP "[GCC " __VERSION__ ARCH_SUFFIX "]"
+#endif
 // Generic fallbacks.
 #elif defined(__cplusplus)
 #define COMPILER "[C++]"
