mirror of
https://github.com/ultrajson/ultrajson.git
synced 2024-11-23 20:53:30 +01:00
Silence warning about unused PyIntToINTXX
Make the declaration of PyIntToINT32/PyIntToINT64 conditional; otherwise the compiler always warns about one of them being unused.
This commit is contained in:
parent
5d157b4c29
commit
343d36719b
@ -96,19 +96,21 @@ void initObjToJSON(void)
|
||||
PyDateTime_IMPORT;
|
||||
}
|
||||
|
||||
static void *PyIntToINT32(JSOBJ _obj, JSONTypeContext *tc, void *outValue, size_t *_outLen)
|
||||
{
|
||||
PyObject *obj = (PyObject *) _obj;
|
||||
*((JSINT32 *) outValue) = PyInt_AS_LONG (obj);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef _LP64
|
||||
static void *PyIntToINT64(JSOBJ _obj, JSONTypeContext *tc, void *outValue, size_t *_outLen)
|
||||
{
|
||||
PyObject *obj = (PyObject *) _obj;
|
||||
*((JSINT64 *) outValue) = PyInt_AS_LONG (obj);
|
||||
return NULL;
|
||||
}
|
||||
#else
|
||||
static void *PyIntToINT32(JSOBJ _obj, JSONTypeContext *tc, void *outValue, size_t *_outLen)
|
||||
{
|
||||
PyObject *obj = (PyObject *) _obj;
|
||||
*((JSINT32 *) outValue) = PyInt_AS_LONG (obj);
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void *PyLongToINT64(JSOBJ _obj, JSONTypeContext *tc, void *outValue, size_t *_outLen)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user