Skip to content

Commit 09cf01d

Browse files
agattidpgeorge
authored andcommitted
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 <[email protected]>
1 parent 579e840 commit 09cf01d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

extmod/modplatform.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,13 @@
5353
#define MICROPY_PLATFORM_ARCH ""
5454
#endif
5555

56-
#if defined(__GNUC__)
56+
#if defined(__clang__)
57+
#define MICROPY_PLATFORM_COMPILER \
58+
"Clang " \
59+
MP_STRINGIFY(__clang_major__) "." \
60+
MP_STRINGIFY(__clang_minor__) "." \
61+
MP_STRINGIFY(__clang_patchlevel__)
62+
#elif defined(__GNUC__)
5763
#define MICROPY_PLATFORM_COMPILER \
5864
"GCC " \
5965
MP_STRINGIFY(__GNUC__) "." \

0 commit comments

Comments
 (0)