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>
This commit is contained in:
Alessandro Gatti 2024-11-20 19:11:30 +01:00 committed by Damien George
parent 579e840de6
commit 09cf01d7c1

View file

@ -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__) "." \