Commit c62e213a authored by Robert Bradshaw's avatar Robert Bradshaw

Fix for setting real/imaginary parts for MSVC C++.

parent 6b8bbcb5
...@@ -3091,6 +3091,11 @@ class AttributeNode(ExprNode): ...@@ -3091,6 +3091,11 @@ class AttributeNode(ExprNode):
rhs.py_result())) rhs.py_result()))
rhs.generate_disposal_code(code) rhs.generate_disposal_code(code)
rhs.free_temps(code) rhs.free_temps(code)
elif self.obj.type.is_complex:
code.putln("__Pyx_SET_C%s(%s, %s);" % (
self.member.upper(),
self.obj.result_as(self.obj.type),
rhs.result_as(self.ctype())))
else: else:
if (self.obj.type.is_extension_type if (self.obj.type.is_extension_type
and self.needs_none_check and self.needs_none_check
......
...@@ -1057,6 +1057,14 @@ proto=""" ...@@ -1057,6 +1057,14 @@ proto="""
#define __Pyx_CREAL(z) ((z).real) #define __Pyx_CREAL(z) ((z).real)
#define __Pyx_CIMAG(z) ((z).imag) #define __Pyx_CIMAG(z) ((z).imag)
#endif #endif
#if defined(_WIN32) && defined(__cplusplus) && CYTHON_CCOMPLEX
#define __Pyx_SET_CREAL(z,x) ((z).real(x))
#define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
#define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
#define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
#endif
""") """)
complex_type_utility_code = UtilityCode( complex_type_utility_code = UtilityCode(
......
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