Moved datatime compatibility macros with others

This commit is contained in:
Daniele Varrazzo 2018-01-10 22:24:05 +00:00
parent 3fcb035126
commit 77c703395b
2 changed files with 5 additions and 6 deletions

View File

@ -93,12 +93,6 @@ error:
return rv;
}
#ifndef PyDateTime_DELTA_GET_DAYS
#define PyDateTime_DELTA_GET_DAYS(o) (o->days)
#define PyDateTime_DELTA_GET_SECONDS(o) (o->seconds)
#define PyDateTime_DELTA_GET_MICROSECONDS(o) (o->microseconds)
#endif
static PyObject *
_pydatetime_string_delta(pydatetimeObject *self)
{

View File

@ -87,6 +87,7 @@ typedef unsigned long Py_uhash_t;
#ifndef PyNumber_Int
#define PyNumber_Int PyNumber_Long
#endif
#endif /* PY_MAJOR_VERSION > 2 */
#if PY_MAJOR_VERSION < 3
@ -104,6 +105,10 @@ typedef unsigned long Py_uhash_t;
#define Bytes_ConcatAndDel PyString_ConcatAndDel
#define _Bytes_Resize _PyString_Resize
#define PyDateTime_DELTA_GET_DAYS(o) (((PyDateTime_Delta*)o)->days)
#define PyDateTime_DELTA_GET_SECONDS(o) (((PyDateTime_Delta*)o)->seconds)
#define PyDateTime_DELTA_GET_MICROSECONDS(o) (((PyDateTime_Delta*)o)->microseconds)
#else
#define Bytes_Type PyBytes_Type