Added a few compatibility macros defined in Py 2.6.

This commit is contained in:
Daniele Varrazzo 2010-12-12 21:30:00 +00:00
parent 9b29282ee4
commit 2196ff5488

View File

@ -51,8 +51,12 @@
#define CONV_CODE_PY_SSIZE_T "n" #define CONV_CODE_PY_SSIZE_T "n"
#endif #endif
#ifndef Py_TYPE /* Macros defined in Python 2.6 */
#define Py_TYPE(o) (((PyObject*)(o))->ob_type) #ifndef Py_REFCNT
#define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
#define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
#define PyVarObject_HEAD_INIT(x,n) PyObject_HEAD_INIT(x) n,
#endif #endif
/* FORMAT_CODE_PY_SSIZE_T is for Py_ssize_t: */ /* FORMAT_CODE_PY_SSIZE_T is for Py_ssize_t: */