diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2012-05-12 08:35:52 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2012-05-12 08:35:52 +0200 |
commit | 7e4aaf0c4ccb685bb63a7b6f6953b9ec3caca8cb (patch) | |
tree | e394b01847789f035aac65145949204bb5924cb3 /Cython/Utility/ModuleSetupCode.c | |
parent | 17ebc936e7ea9f225433e7c494002d2e154e5edd (diff) | |
download | cython-7e4aaf0c4ccb685bb63a7b6f6953b9ec3caca8cb.tar.gz |
macro fix for Py2.4 in C++ mode
Diffstat (limited to 'Cython/Utility/ModuleSetupCode.c')
-rw-r--r-- | Cython/Utility/ModuleSetupCode.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c index e727ec542..37443d96e 100644 --- a/Cython/Utility/ModuleSetupCode.c +++ b/Cython/Utility/ModuleSetupCode.c @@ -47,10 +47,10 @@ #define PY_FORMAT_SIZE_T "" #define PyInt_FromSsize_t(z) PyInt_FromLong(z) #define PyInt_AsSsize_t(o) __Pyx_PyInt_AsInt(o) - #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? \ - PyNumber_Int(o) \ - : (PyErr_Format(PyExc_TypeError, "expected index value, got %.200s", \ - Py_TYPE(o)->tp_name), NULL)) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) #define PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && !PyComplex_Check(o)) #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) #define __PYX_BUILD_PY_SSIZE_T "i" |