From 7faf7e50757dde2cb8583ee08ef31f4b8312e44f Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Thu, 5 Oct 2017 21:15:14 -0700 Subject: closes bpo-31696: don't mention GCC in sys.version when building with clang (#3891) --- Python/getcompiler.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'Python/getcompiler.c') diff --git a/Python/getcompiler.c b/Python/getcompiler.c index 9d9c33ac2d..59c0dbf92a 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]" -- cgit v1.2.1