|
40 | 40 |
|
41 | 41 | #if defined(__ARM_ARCH)
|
42 | 42 | #define PLATFORM_ARCH "arm"
|
43 |
| -#elif defined(__x86_64__) |
| 43 | +#elif defined(__x86_64__) || defined(_WIN64) |
44 | 44 | #define PLATFORM_ARCH "x86_64"
|
| 45 | +#elif defined(__i386__) || defined(_M_IX86) |
| 46 | +#define PLATFORM_ARCH "x86" |
45 | 47 | #else
|
46 | 48 | #define PLATFORM_ARCH ""
|
47 | 49 | #endif
|
|
58 | 60 | MP_STRINGIFY((__ARMCC_VERSION / 1000000)) "." \
|
59 | 61 | MP_STRINGIFY((__ARMCC_VERSION / 10000 % 100)) "." \
|
60 | 62 | MP_STRINGIFY((__ARMCC_VERSION % 10000))
|
| 63 | +#elif defined(_MSC_VER) |
| 64 | +#if defined(_WIN64) |
| 65 | +#define COMPILER_BITS "64 bit" |
| 66 | +#elif defined(_M_IX86) |
| 67 | +#define COMPILER_BITS "32 bit" |
| 68 | +#else |
| 69 | +#define COMPILER_BITS "" |
| 70 | +#endif |
| 71 | +#define PLATFORM_COMPILER \ |
| 72 | + "MSC v." MP_STRINGIFY(_MSC_VER) " " COMPILER_BITS |
61 | 73 | #else
|
62 | 74 | #define PLATFORM_COMPILER ""
|
63 | 75 | #endif
|
|
81 | 93 | #define PLATFORM_SYSTEM "Unix"
|
82 | 94 | #elif defined(__CYGWIN__)
|
83 | 95 | #define PLATFORM_SYSTEM "Cygwin"
|
84 |
| -#elif defined(__WIN32__) |
| 96 | +#elif defined(_WIN32) |
85 | 97 | #define PLATFORM_SYSTEM "Windows"
|
86 | 98 | #else
|
87 | 99 | #define PLATFORM_SYSTEM "MicroPython"
|
|
95 | 107 | #define MICROPY_HW_MCU_NAME ""
|
96 | 108 | #endif
|
97 | 109 |
|
| 110 | +#ifndef MICROPY_HAL_VERSION |
| 111 | +#define MICROPY_HAL_VERSION "" |
| 112 | +#endif |
| 113 | + |
98 | 114 | STATIC const MP_DEFINE_STR_OBJ(info_platform_obj, PLATFORM_SYSTEM "-" MICROPY_VERSION_STRING "-HAL" \
|
99 | 115 | MICROPY_HAL_VERSION "-" PLATFORM_ARCH "-with-" PLATFORM_LIBC_LIB "" PLATFORM_LIBC_VER);
|
100 | 116 | STATIC const MP_DEFINE_STR_OBJ(info_python_compiler_obj, PLATFORM_COMPILER);
|
|
0 commit comments