chiark
/
gitweb
/
~mdw
/
pyke
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Various minor fixings.
[pyke]
/
catacomb.c
diff --git
a/catacomb.c
b/catacomb.c
index 742ce5fb73048b9cea754ee1b454198fbc35a52e..acc0e35e382e1e15ec5cfa414890ed02f3b448cf 100644
(file)
--- a/
catacomb.c
+++ b/
catacomb.c
@@
-238,7
+238,12
@@
static const PyTypeObject emptytype = { 0 };
void *newtype(PyTypeObject *metaty, const PyTypeObject *skel)
{
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);
if (!skel) skel = &emptytype;
memcpy(ty, skel, sizeof(*skel));
if (ty->tp_base) Py_INCREF(ty->tp_base);