Various minor fixings.
authormdw <mdw>
Sun, 10 Apr 2005 23:38:11 +0000 (23:38 +0000)
committermdw <mdw>
Sun, 10 Apr 2005 23:38:11 +0000 (23:38 +0000)
catacomb.c

index 742ce5f..acc0e35 100644 (file)
@@ -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);