mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-26 10:53:44 +03:00
Added a few compatibility macros defined in Py 2.6.
This commit is contained in:
parent
9b29282ee4
commit
2196ff5488
|
@ -51,8 +51,12 @@
|
|||
#define CONV_CODE_PY_SSIZE_T "n"
|
||||
#endif
|
||||
|
||||
#ifndef Py_TYPE
|
||||
#define Py_TYPE(o) (((PyObject*)(o))->ob_type)
|
||||
/* Macros defined in Python 2.6 */
|
||||
#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
|
||||
|
||||
/* FORMAT_CODE_PY_SSIZE_T is for Py_ssize_t: */
|
||||
|
|
Loading…
Reference in New Issue
Block a user