diff options
author | Alexey Borzenkov <snaury@gmail.com> | 2014-06-24 03:10:16 +0400 |
---|---|---|
committer | Alexey Borzenkov <snaury@gmail.com> | 2014-06-24 03:10:16 +0400 |
commit | 892319cdf6f6be58574b21293dcbbd2c40b802a0 (patch) | |
tree | 54d791878a61c0087b1243b2587249f22f34a672 | |
parent | 40a2731e3335fbb4c287c5f4081801c2eca9aed8 (diff) | |
download | greenlet-892319cdf6f6be58574b21293dcbbd2c40b802a0.tar.gz |
Define and use PyVarObject_HEAD_INIT compatibility macro
Based on pull request #32
-rw-r--r-- | greenlet.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -84,6 +84,10 @@ The running greenlet's stack_start is undefined but not NULL. #ifndef Py_TYPE # define Py_TYPE(ob) (((PyObject *) (ob))->ob_type) #endif +#ifndef PyVarObject_HEAD_INIT +# define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, +#endif #endif #if PY_VERSION_HEX < 0x02050000 @@ -1433,12 +1437,7 @@ static PyNumberMethods green_as_number = { PyTypeObject PyGreenlet_Type = { -#if PY_MAJOR_VERSION >= 3 PyVarObject_HEAD_INIT(NULL, 0) -#else - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -#endif "greenlet.greenlet", /* tp_name */ sizeof(PyGreenlet), /* tp_basicsize */ 0, /* tp_itemsize */ |