summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Epler <jepler@unpythonic.net>2025-09-30 15:56:35 -0500
committerDamien George <damien@micropython.org>2025-10-03 00:45:31 +1000
commitab0080602578ce789d784aaaf50511313db70bc7 (patch)
tree5d8ba0bc50b0e96a9eb0f7d9d74aa350f671f509
parentbb205f093191c0a4d1b1835f3442dbda40e8eab8 (diff)
py/mpconfig: Introduce SIZE_FMT macro.
Signed-off-by: Jeff Epler <jepler@unpythonic.net>
-rw-r--r--ports/stm32/mpconfigport_nanbox.h1
-rw-r--r--ports/unix/variants/nanbox/mpconfigvariant.h1
-rw-r--r--py/mpconfig.h3
3 files changed, 5 insertions, 0 deletions
diff --git a/ports/stm32/mpconfigport_nanbox.h b/ports/stm32/mpconfigport_nanbox.h
index ffd87ba2f..7e9306aab 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 8b23b93a8..39969814a 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 a6a21dd1c..c25401b8c 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