check size of integers if possible

This commit is contained in:
Jeff Epler 2021-11-12 10:15:12 -06:00
parent accadf9c25
commit a1069ebcc2
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE

View File

@ -176,6 +176,10 @@ extern void common_hal_mcu_enable_interrupts(void);
#define INT_FMT "%d"
typedef int mp_int_t; // must be pointer size
typedef unsigned mp_uint_t; // must be pointer size
#if __GNUC__ >= 10 // on recent gcc versions we can check that this is so
_Static_assert(sizeof(mp_int_t) == sizeof(void *));
_Static_assert(sizeof(mp_uint_t) == sizeof(void *));
#endif
typedef long mp_off_t;
#define MP_PLAT_PRINT_STRN(str, len) mp_hal_stdout_tx_strn_cooked(str, len)