From: mdw Date: Sun, 10 Apr 2005 23:38:11 +0000 (+0000) Subject: Various minor fixings. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/pyke/commitdiff_plain/60a7d03c35074d3e841b028cd3e0fd2763b289f7 Various minor fixings. --- 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);