diff options
Diffstat (limited to 'Include/objimpl.h')
-rw-r--r-- | Include/objimpl.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Include/objimpl.h b/Include/objimpl.h index 03b6a8d..9f8523f 100644 --- a/Include/objimpl.h +++ b/Include/objimpl.h @@ -154,9 +154,9 @@ PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t); /* Macros trading binary compatibility for speed. See also pymem.h. Note that these macros expect non-NULL object pointers.*/ #define PyObject_INIT(op, typeobj) \ - ( (op)->ob_type = (typeobj), _Py_NewReference((PyObject *)(op)), (op) ) + ( Py_Type(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op) ) #define PyObject_INIT_VAR(op, typeobj, size) \ - ( (op)->ob_size = (size), PyObject_INIT((op), (typeobj)) ) + ( Py_Size(op) = (size), PyObject_INIT((op), (typeobj)) ) #define _PyObject_SIZE(typeobj) ( (typeobj)->tp_basicsize ) @@ -231,8 +231,8 @@ PyAPI_FUNC(Py_ssize_t) PyGC_Collect(void); #define PyType_IS_GC(t) PyType_HasFeature((t), Py_TPFLAGS_HAVE_GC) /* Test if an object has a GC head */ -#define PyObject_IS_GC(o) (PyType_IS_GC((o)->ob_type) && \ - ((o)->ob_type->tp_is_gc == NULL || (o)->ob_type->tp_is_gc(o))) +#define PyObject_IS_GC(o) (PyType_IS_GC(Py_Type(o)) && \ + (Py_Type(o)->tp_is_gc == NULL || Py_Type(o)->tp_is_gc(o))) PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, Py_ssize_t); #define PyObject_GC_Resize(type, op, n) \ @@ -328,7 +328,7 @@ PyAPI_FUNC(void) PyObject_GC_Del(void *); && ((t)->tp_weaklistoffset > 0)) #define PyObject_GET_WEAKREFS_LISTPTR(o) \ - ((PyObject **) (((char *) (o)) + (o)->ob_type->tp_weaklistoffset)) + ((PyObject **) (((char *) (o)) + Py_Type(o)->tp_weaklistoffset)) #ifdef __cplusplus } |