diff options
| author | Jeff Epler <jepler@unpythonic.net> | 2025-10-11 19:12:55 -0500 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-10-23 15:12:28 +1100 |
| commit | 007f127a61ea058ca010b85883072bdefe0234c0 (patch) | |
| tree | f39d63b4cdc67ff1374b4e774511e9bb07718c58 /py/mpprint.c | |
| parent | eac81de4e0a462dd8121f93b42271774ced3c85f (diff) | |
all: Simplify mp_int_t/mp_uint_t definition.
Assuming proper C99 language support, we can select "the int type as big as
a pointer" (most of the time) or "the 64-bit int type" (nanboxing with
REPR_D), and then define everything else automatically.
This simplifies port configuration files. And the types can still be
overridden if needed.
Signed-off-by: Jeff Epler <jepler@unpythonic.net>
Diffstat (limited to 'py/mpprint.c')
| -rw-r--r-- | py/mpprint.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/py/mpprint.c b/py/mpprint.c index 89b3dbd76..fa37a4d07 100644 --- a/py/mpprint.c +++ b/py/mpprint.c @@ -482,7 +482,7 @@ int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args) { } // parse long and long long specifiers (only where they make a difference) - #if defined(MICROPY_UNIX_COVERAGE) || (LONG_MAX > INT_MAX) + #if (MP_INT_MAX > INT_MAX && MP_INT_MAX == LONG_MAX) || defined(MICROPY_UNIX_COVERAGE) #define SUPPORT_L_FORMAT (1) #else #define SUPPORT_L_FORMAT (0) @@ -491,7 +491,7 @@ int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args) { bool long_arg = false; #endif - #if (MICROPY_OBJ_REPR == MICROPY_OBJ_REPR_D) || defined(_WIN64) || defined(MICROPY_UNIX_COVERAGE) + #if (MP_INT_MAX > LONG_MAX) || defined(MICROPY_UNIX_COVERAGE) #define SUPPORT_LL_FORMAT (1) #else #define SUPPORT_LL_FORMAT (0) |
