bpo-39573: Convert Py_REFCNT and Py_SIZE to functions (GH-20429)
Convert Py_REFCNT() and Py_SIZE() macros to static inline functions.
They cannot be used as l-value anymore: use Py_SET_REFCNT() and
Py_SET_SIZE() to set an object reference count and size.
Replace &Py_SIZE(self) with &((PyVarObject*)self)->ob_size
in arraymodule.c.
This change is backward incompatible on purpose, to prepare the C API
for an opaque PyObject structure.
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index e4c0c91..43706c2 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -82,7 +82,7 @@
numfree[size]--;
/* Inline PyObject_InitVar */
#ifdef Py_TRACE_REFS
- Py_SIZE(op) = size;
+ Py_SET_SIZE(op, size);
Py_SET_TYPE(op, &PyTuple_Type);
#endif
_Py_NewReference((PyObject *)op);