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);