Fix build and tests.

This commit is contained in:
INADA Naoki 2014-08-31 02:29:05 +09:00
parent 5cfa49bb2c
commit d6c773dc4d
2 changed files with 3 additions and 11 deletions

View file

@ -55,15 +55,7 @@ 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
#endif
{
p = PyInt_FromUnsignedLong((long)d);
}
PyObject *p = PyInt_FromSize_t((size_t)d);
if (!p)
return -1;
*o = p;