Commit 9ea16572 authored by Stefan Behnel's avatar Stefan Behnel

avoid direct usage of PyComplexObject struct when not building in CPython

--HG--
extra : transplant_source : 8%3D%9FB%EA%E9%08%0A%7B%CB%92%ED%89%ADzL%9Du6%E9
parent 7026837e
...@@ -1942,9 +1942,11 @@ static %(type)s __Pyx_PyComplex_As_%(type_name)s(PyObject*); ...@@ -1942,9 +1942,11 @@ static %(type)s __Pyx_PyComplex_As_%(type_name)s(PyObject*);
impl=""" impl="""
static %(type)s __Pyx_PyComplex_As_%(type_name)s(PyObject* o) { static %(type)s __Pyx_PyComplex_As_%(type_name)s(PyObject* o) {
Py_complex cval; Py_complex cval;
#if CYTHON_COMPILING_IN_CPYTHON
if (PyComplex_CheckExact(o)) if (PyComplex_CheckExact(o))
cval = ((PyComplexObject *)o)->cval; cval = ((PyComplexObject *)o)->cval;
else else
#endif
cval = PyComplex_AsCComplex(o); cval = PyComplex_AsCComplex(o);
return %(type_name)s_from_parts( return %(type_name)s_from_parts(
(%(real_type)s)cval.real, (%(real_type)s)cval.real,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment