8000 check size of integers if possible · jcbender/circuitpython@a1069eb · GitHub
[go: up one dir, main page]

Skip to content

Commit a1069eb

Browse files
committed
check size of integers if possible
1 parent accadf9 commit a1069eb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

py/circuitpy_mpconfig.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ extern void common_hal_mcu_enable_interrupts(void);
176176
#define INT_FMT "%d"
177177
typedef int mp_int_t; // must be pointer size
178178
typedef unsigned mp_uint_t; // must be pointer size
179+
#if __GNUC__ >= 10 // on recent gcc versions we can check that this is so
180+
_Static_assert(sizeof(mp_int_t) == sizeof(void *));
181+
_Static_assert(sizeof(mp_uint_t) == sizeof(void *));
182+
#endif
179183
typedef long mp_off_t;
180184

181185
#define MP_PLAT_PRINT_STRN(str, len) mp_hal_stdout_tx_strn_cooked(str, len)

0 commit comments

Comments
 (0)
0