From 60a7d03c35074d3e841b028cd3e0fd2763b289f7 Mon Sep 17 00:00:00 2001 From: mdw Date: Sun, 10 Apr 2005 23:38:11 +0000 Subject: [PATCH] Various minor fixings. --- catacomb.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/catacomb.c b/catacomb.c index 742ce5f..acc0e35 100644 --- a/catacomb.c +++ b/catacomb.c @@ -238,7 +238,12 @@ static const PyTypeObject emptytype = { 0 }; void *newtype(PyTypeObject *metaty, const PyTypeObject *skel) { - PyTypeObject *ty = (PyTypeObject *)_PyObject_GC_Malloc(metaty, 0); + PyTypeObject *ty = +#if PY_VERSION_HEX < 0x02030000 + (PyTypeObject *)_PyObject_GC_Malloc(metaty, 0); +#else + (PyTypeObject *)_PyObject_GC_Malloc(_PyObject_VAR_SIZE(metaty, 0)); +#endif if (!skel) skel = &emptytype; memcpy(ty, skel, sizeof(*skel)); if (ty->tp_base) Py_INCREF(ty->tp_base); -- 2.11.0