diff options
Diffstat (limited to 'siplib/sip-tqt.h')
-rw-r--r-- | siplib/sip-tqt.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/siplib/sip-tqt.h b/siplib/sip-tqt.h index 845ed6d..a35887b 100644 --- a/siplib/sip-tqt.h +++ b/siplib/sip-tqt.h @@ -208,10 +208,14 @@ extern "C" { #define SIPBytes_AS_STRING PyBytes_AS_STRING #define SIPBytes_GET_SIZE PyBytes_GET_SIZE -#if PY_MINOR_VERSION >= 1 +#if (PY_MAJOR_VERSION > 3) || ((PY_MAJOR_VERSION == 3) && (PY_MINOR_VERSION >= 1)) #define SIP_USE_PYCAPSULE #endif +#if (PY_MAJOR_VERSION == 3) && (PY_MINOR_VERSION < 2) +#define SIP_SUPPORT_PYCOBJECT +#endif + #else #define SIPLong_FromLong PyInt_FromLong @@ -227,6 +231,8 @@ extern "C" { #define SIP_USE_PYCAPSULE #endif +#define SIP_SUPPORT_PYCOBJECT + #endif #if !defined(Py_REFCNT) @@ -1465,9 +1471,15 @@ typedef struct _sipTQtAPI { #define sipIsExactWrappedType(wt) (sipTypeAsPyTypeObject((wt)->type) == (PyTypeObject *)(wt)) +#if PY_VERSION_HEX >= 0x03020000 +#define sipConvertFromSliceObject(o,len,start,stop,step,slen) \ + PySlice_GetIndicesEx((o), (len), (start), (stop), \ + (step), (slen)) +#else #define sipConvertFromSliceObject(o,len,start,stop,step,slen) \ PySlice_GetIndicesEx((PySliceObject *)(o), (len), (start), (stop), \ (step), (slen)) +#endif /* |