From ab0080602578ce789d784aaaf50511313db70bc7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 30 Sep 2025 15:56:35 -0500 Subject: [PATCH] py/mpconfig: Introduce SIZE_FMT macro. Signed-off-by: Jeff Epler --- ports/stm32/mpconfigport_nanbox.h | 1 + ports/unix/variants/nanbox/mpconfigvariant.h | 1 + py/mpconfig.h | 3 +++ 3 files changed, 5 insertions(+) diff --git a/ports/stm32/mpconfigport_nanbox.h b/ports/stm32/mpconfigport_nanbox.h index ffd87ba2f6..7e9306aab8 100644 --- a/ports/stm32/mpconfigport_nanbox.h +++ b/ports/stm32/mpconfigport_nanbox.h @@ -37,6 +37,7 @@ #define UINT_FMT "%llu" #define INT_FMT "%lld" #define HEX_FMT "%llx" +#define SIZE_FMT "%lu" typedef int64_t mp_int_t; typedef uint64_t mp_uint_t; diff --git a/ports/unix/variants/nanbox/mpconfigvariant.h b/ports/unix/variants/nanbox/mpconfigvariant.h index 8b23b93a8d..39969814ae 100644 --- a/ports/unix/variants/nanbox/mpconfigvariant.h +++ b/ports/unix/variants/nanbox/mpconfigvariant.h @@ -49,3 +49,4 @@ typedef uint64_t mp_uint_t; #define UINT_FMT "%llu" #define INT_FMT "%lld" #define HEX_FMT "%llx" +#define SIZE_FMT "%lu" diff --git a/py/mpconfig.h b/py/mpconfig.h index a6a21dd1c0..c25401b8ca 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -2244,15 +2244,18 @@ typedef time_t mp_timestamp_t; #define UINT_FMT "%lu" #define INT_FMT "%ld" #define HEX_FMT "%lx" +#define SIZE_FMT "%lu" #elif defined(_WIN64) #define UINT_FMT "%llu" #define INT_FMT "%lld" #define HEX_FMT "%llx" +#define SIZE_FMT "%llu" #else // Archs where mp_int_t == int #define UINT_FMT "%u" #define INT_FMT "%d" #define HEX_FMT "%x" +#define SIZE_FMT "%u" #endif #endif // INT_FMT