diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-07-03 16:50:11 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-07-03 18:09:36 +0300 |
commit | 4e0eeebdc2b452277c24f554c444f0cc0de9e4ea (patch) | |
tree | 6cda2dd6ff6fe129338c8980b045dbde1ba16645 /py/objint_longlong.c | |
parent | 381618269a9eb3e49d0e42d389d2dec312907577 (diff) |
py: Implement sys.maxsize, standard way to check platform "bitness".
Implementing it as a static constant is a bit peculiar and require cooperation
from long int implementation.
Diffstat (limited to 'py/objint_longlong.c')
-rw-r--r-- | py/objint_longlong.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/py/objint_longlong.c b/py/objint_longlong.c index 13e3b4811..637d9c32c 100644 --- a/py/objint_longlong.c +++ b/py/objint_longlong.c @@ -50,6 +50,11 @@ #define SUFFIX "" #endif +#if MICROPY_PY_SYS_MAXSIZE +// Export value for sys.maxsize +const mp_obj_int_t mp_maxsize_obj = {{&mp_type_int}, INT_MAX}; +#endif + bool mp_obj_int_is_positive(mp_obj_t self_in) { if (MP_OBJ_IS_SMALL_INT(self_in)) { return MP_OBJ_SMALL_INT_VALUE(self_in) >= 0; |