From d2fc8010342512378e01322f8871c10a5974af4f Mon Sep 17 00:00:00 2001 From: INADA Naoki Date: Thu, 13 Feb 2014 01:57:34 +0900 Subject: Fix warning on 64bit environment. --- msgpack/unpack.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- cgit v1.2.1