diff options
author | INADA Naoki <inada-n@klab.com> | 2014-02-13 01:57:34 +0900 |
---|---|---|
committer | INADA Naoki <inada-n@klab.com> | 2014-02-13 01:57:34 +0900 |
commit | d2fc8010342512378e01322f8871c10a5974af4f (patch) | |
tree | 6a1636313cd7663743e5dbc832e4eab0fac8f1db /msgpack | |
parent | f322ed4e1bc3b9243b187df31af1f2d72876b9b6 (diff) | |
download | msgpack-python-d2fc8010342512378e01322f8871c10a5974af4f.tar.gz |
Fix warning on 64bit environment.
Diffstat (limited to 'msgpack')
-rw-r--r-- | msgpack/unpack.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/msgpack/unpack.h b/msgpack/unpack.h index aced40b..27e3b62 100644 --- a/msgpack/unpack.h +++ b/msgpack/unpack.h @@ -56,9 +56,12 @@ static inline int unpack_callback_uint8(unpack_user* u, uint8_t d, msgpack_unpac static inline int unpack_callback_uint32(unpack_user* u, uint32_t d, msgpack_unpack_object* o) { PyObject *p; +#if UINT32_MAX > LONG_MAX if (d > LONG_MAX) { p = PyLong_FromUnsignedLong((unsigned long)d); - } else { + } else +#endif + { p = PyInt_FromLong((long)d); } if (!p) |