summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2017-10-06 04:15:14 (GMT)
committerGitHub <noreply@github.com>2017-10-06 04:15:14 (GMT)
commit7faf7e50757dde2cb8583ee08ef31f4b8312e44f (patch)
tree40329c060cb97d0d30919b4ea62ba9ef836b8dc7 /Python
parentac317700ce7439e38a8b420218d9a5035bba92ed (diff)
downloadcpython-7faf7e50757dde2cb8583ee08ef31f4b8312e44f.zip
cpython-7faf7e50757dde2cb8583ee08ef31f4b8312e44f.tar.gz
cpython-7faf7e50757dde2cb8583ee08ef31f4b8312e44f.tar.bz2
closes bpo-31696: don't mention GCC in sys.version when building with clang (#3891)
Diffstat (limited to 'Python')
-rw-r--r--Python/getcompiler.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/Python/getcompiler.c b/Python/getcompiler.c
index 9d9c33a..59c0dbf 100644
--- a/Python/getcompiler.c
+++ b/Python/getcompiler.c
@@ -5,15 +5,14 @@
#ifndef COMPILER
-#ifdef __GNUC__
+// Note the __clang__ conditional has to come before the __GNUC__ one because
+// clang pretends to be GCC.
+#if defined(__clang__)
+#define COMPILER "\n[Clang " __clang_version__ "]"
+#elif defined(__GNUC__)
#define COMPILER "\n[GCC " __VERSION__ "]"
-#endif
-
-#endif /* !COMPILER */
-
-#ifndef COMPILER
-
-#ifdef __cplusplus
+// Generic fallbacks.
+#elif defined(__cplusplus)
#define COMPILER "[C++]"
#else
#define COMPILER "[C]"