Showing the changes to python (4 of 4 files). Show all
Unified · Split
| @@ -39,6 +39,11 @@ · 38 unmodified lines | |||
| 39 | #define AUBIO_NPY_SMPL NPY_FLOAT | 39 | #define AUBIO_NPY_SMPL NPY_FLOAT |
| 40 | #endif | 40 | #endif |
| 41 | 41 | ||
| 42 | // compat with Python < 2.6 | ||
| 43 | #ifndef Py_TYPE | ||
| 44 | #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) | ||
| 45 | #endif | ||
| 46 | |||
| 42 | // special python type for cvec | 47 | // special python type for cvec |
| 43 | typedef struct | 48 | typedef struct |
| 44 | { | 49 | { |
| @@ -25,7 +25,7 @@ static void \ · 24 unmodified lines | |||
| 25 | Py_ ## NAME ## _del ( Py_ ## NAME * self) \ | 25 | Py_ ## NAME ## _del ( Py_ ## NAME * self) \ |
| 26 | { \ | 26 | { \ |
| 27 | del_aubio_ ## NAME (self->o); \ | 27 | del_aubio_ ## NAME (self->o); \ |
| 28 | self->ob_type->tp_free ((PyObject *) self); \ | 28 | Py_TYPE(self)->tp_free ((PyObject *) self); \ |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | #define AUBIO_MEMBERS_START(NAME) \ | 31 | #define AUBIO_MEMBERS_START(NAME) \ |
| @@ -59,7 +59,7 @@ static void · 58 unmodified lines | |||
| 59 | Py_cvec_del (Py_cvec * self) | 59 | Py_cvec_del (Py_cvec * self) |
| 60 | { | 60 | { |
| 61 | del_cvec (self->o); | 61 | del_cvec (self->o); |
| 62 | self->ob_type->tp_free ((PyObject *) self); | 62 | Py_TYPE(self)->tp_free ((PyObject *) self); |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | static PyObject * | 65 | static PyObject * |
| @@ -55,7 +55,7 @@ static void · 54 unmodified lines | |||
| 55 | Py_filter_del (Py_filter * self) | 55 | Py_filter_del (Py_filter * self) |
| 56 | { | 56 | { |
| 57 | del_aubio_filter (self->o); | 57 | del_aubio_filter (self->o); |
| 58 | self->ob_type->tp_free ((PyObject *) self); | 58 | Py_TYPE(self)->tp_free ((PyObject *) self); |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | static PyObject * | 61 | static PyObject * |