summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-09-06 17:37:29 +0100
committerDamien George <damien.p.george@gmail.com>2014-09-06 17:37:29 +0100
commit8002d5d2b986eb551ae3adcb0bd3c31454b63224 (patch)
treeef0000fc769a0beb96575addabc5a7c842fd1edb /py
parent9a21d2e070c9ee0ef2c003f3a668e635c6ae4401 (diff)
downloadmicropython-8002d5d2b986eb551ae3adcb0bd3c31454b63224.tar.gz
micropython-8002d5d2b986eb551ae3adcb0bd3c31454b63224.zip
py: Fix definition of sys.maxsize with mpz changes.
Diffstat (limited to 'py')
-rw-r--r--py/objint_mpz.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/py/objint_mpz.c b/py/objint_mpz.c
index 542a063566..20fba00bf7 100644
--- a/py/objint_mpz.c
+++ b/py/objint_mpz.c
@@ -45,16 +45,18 @@
#if MICROPY_PY_SYS_MAXSIZE
// Export value for sys.maxsize
-#define DIG_MASK ((1 << MPZ_DIG_SIZE) - 1)
+#define DIG_MASK ((1L << MPZ_DIG_SIZE) - 1)
STATIC const mpz_dig_t maxsize_dig[MPZ_NUM_DIG_FOR_INT] = {
(INT_MAX >> MPZ_DIG_SIZE * 0) & DIG_MASK,
+ #if (INT_MAX >> MPZ_DIG_SIZE * 0) > DIG_MASK
(INT_MAX >> MPZ_DIG_SIZE * 1) & DIG_MASK,
+ #if (INT_MAX >> MPZ_DIG_SIZE * 1) > DIG_MASK
(INT_MAX >> MPZ_DIG_SIZE * 2) & DIG_MASK,
- #if (INT_MAX >> MPZ_DIG_SIZE * 2) > DIG_MASK
(INT_MAX >> MPZ_DIG_SIZE * 3) & DIG_MASK,
(INT_MAX >> MPZ_DIG_SIZE * 4) & DIG_MASK,
// (INT_MAX >> MPZ_DIG_SIZE * 5) & DIG_MASK,
#endif
+ #endif
};
const mp_obj_int_t mp_maxsize_obj = {
{&mp_type_int},