diff options
| author | Alessandro Gatti <a.gatti@frob.it> | 2024-11-20 19:11:30 +0100 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2024-11-30 12:42:51 +1100 |
| commit | 09cf01d7c1f564fd018bd8fb3e6382fbe8cd1e35 (patch) | |
| tree | 29ba0f0477d774e897c1da85b3c71e13629fbc2a /extmod | |
| parent | 579e840de6d71503658f3c427c1e210c7cb85e9e (diff) | |
extmod/modplatform: Add Clang to the known compilers list.
This commit adds support to distinguish between GCC and Clang to report
the appropriate compiler version. Usually Clang also disguises itself
as GCC for compatibility reasons, but these changes look for
Clang-specific definitions first to avoid that problem.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
Diffstat (limited to 'extmod')
| -rw-r--r-- | extmod/modplatform.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/extmod/modplatform.h b/extmod/modplatform.h index 0c83d7b8c..19246c0fd 100644 --- a/extmod/modplatform.h +++ b/extmod/modplatform.h @@ -53,7 +53,13 @@ #define MICROPY_PLATFORM_ARCH "" #endif -#if defined(__GNUC__) +#if defined(__clang__) +#define MICROPY_PLATFORM_COMPILER \ + "Clang " \ + MP_STRINGIFY(__clang_major__) "." \ + MP_STRINGIFY(__clang_minor__) "." \ + MP_STRINGIFY(__clang_patchlevel__) +#elif defined(__GNUC__) #define MICROPY_PLATFORM_COMPILER \ "GCC " \ MP_STRINGIFY(__GNUC__) "." \ |
