diff options
author | Benjamin Peterson <benjamin@python.org> | 2017-10-05 06:41:06 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2017-10-05 07:09:33 (GMT) |
commit | c644009b941db7efaec8f72868766b0aa946d797 (patch) | |
tree | ea3f92fb2d563e3b53078870ed584a53915c0f2f /Python/getcompiler.c | |
parent | a8ed11742b4c2115597977ce04fa8e043d9e0792 (diff) | |
download | cpython-benjamin-clang.zip cpython-benjamin-clang.tar.gz cpython-benjamin-clang.tar.bz2 |
closes bpo-31696: don't mention GCC in sys.version when building with clangbenjamin-clang
Diffstat (limited to 'Python/getcompiler.c')
-rw-r--r-- | Python/getcompiler.c | 15 |
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]" |