Skip to content

Commit 8002d5d

Browse files
committed
py: Fix definition of sys.maxsize with mpz changes.
1 parent 9a21d2e commit 8002d5d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

py/objint_mpz.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,18 @@
4545

4646
#if MICROPY_PY_SYS_MAXSIZE
4747
// Export value for sys.maxsize
48-
#define DIG_MASK ((1 << MPZ_DIG_SIZE) - 1)
48+
#define DIG_MASK ((1L << MPZ_DIG_SIZE) - 1)
4949
STATIC const mpz_dig_t maxsize_dig[MPZ_NUM_DIG_FOR_INT] = {
5050
(INT_MAX >> MPZ_DIG_SIZE * 0) & DIG_MASK,
51+
#if (INT_MAX >> MPZ_DIG_SIZE * 0) > DIG_MASK
5152
(INT_MAX >> MPZ_DIG_SIZE * 1) & DIG_MASK,
53+
#if (INT_MAX >> MPZ_DIG_SIZE * 1) > DIG_MASK
5254
(INT_MAX >> MPZ_DIG_SIZE * 2) & DIG_MASK,
53-
#if (INT_MAX >> MPZ_DIG_SIZE * 2) > DIG_MASK
5455
(INT_MAX >> MPZ_DIG_SIZE * 3) & DIG_MASK,
5556
(INT_MAX >> MPZ_DIG_SIZE * 4) & DIG_MASK,
5657
// (INT_MAX >> MPZ_DIG_SIZE * 5) & DIG_MASK,
5758
#endif
59+
#endif
5860
};
5961
const mp_obj_int_t mp_maxsize_obj = {
6062
{&mp_type_int},

0 commit comments

Comments
 (0)