1
2/* Return the compiler identification, if possible. */
3
4#include "Python.h"
5
6#ifndef COMPILER
7
8// Note the __clang__ conditional has to come before the __GNUC__ one because
9// clang pretends to be GCC.
10#if defined(__clang__)
11#define COMPILER "[Clang " __clang_version__ "]"
12#elif defined(__GNUC__)
13#define COMPILER "[GCC " __VERSION__ "]"
14// Generic fallbacks.
15#elif defined(__cplusplus)
16#define COMPILER "[C++]"
17#else
18#define COMPILER "[C]"
19#endif
20
21#endif /* !COMPILER */
22
23const char *
24Py_GetCompiler(void)
25{
26 return COMPILER;
27}
28