Commit ed7a5bb6 authored by Stefan Behnel's avatar Stefan Behnel

Clarify usage of overloaded C++ function in MSVC++, which complains about its ambiguity.

parent 02c762b4
...@@ -279,7 +279,8 @@ static {{type}} __Pyx_PyComplex_As_{{type_name}}(PyObject* o) { ...@@ -279,7 +279,8 @@ static {{type}} __Pyx_PyComplex_As_{{type_name}}(PyObject* o) {
} }
} else { } else {
r = __Pyx_c_abs{{func_suffix}}(a); r = __Pyx_c_abs{{func_suffix}}(a);
theta = atan2{{m}}(a.imag, a.real); // MSVC++ seems to require the input casts.
theta = atan2{{m}}(({{real_type}})a.imag, ({{real_type}})a.real);
} }
lnr = log{{m}}(r); lnr = log{{m}}(r);
z_r = exp{{m}}(lnr * b.real - theta * b.imag); z_r = exp{{m}}(lnr * b.real - theta * b.imag);
......
...@@ -2,8 +2,13 @@ ...@@ -2,8 +2,13 @@
import cython import cython
cdef extern from "complex_int_T446_fix.h": cdef extern from *:
pass """
#if defined _MSC_VER && defined __cplusplus
#define CYTHON_CCOMPLEX 0
#endif
"""
def test_arith(int complex a, int complex b): def test_arith(int complex a, int complex b):
""" """
......
#if defined _MSC_VER && defined __cplusplus
#define CYTHON_CCOMPLEX 0
#endif
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