Commit 93e0ec35 authored by Robert Bradshaw's avatar Robert Bradshaw

Fix C++ complex for clang.

parent 2cd00ebc
...@@ -1203,7 +1203,7 @@ class CType(PyrexType): ...@@ -1203,7 +1203,7 @@ class CType(PyrexType):
class CConstType(BaseType): class CConstType(BaseType):
is_const = 1 is_const = 1
def __init__(self, const_base_type): def __init__(self, const_base_type):
self.const_base_type = const_base_type self.const_base_type = const_base_type
if const_base_type.has_attributes and const_base_type.scope is not None: if const_base_type.has_attributes and const_base_type.scope is not None:
...@@ -1848,7 +1848,7 @@ proto=""" ...@@ -1848,7 +1848,7 @@ proto="""
#define __Pyx_CIMAG(z) ((z).imag) #define __Pyx_CIMAG(z) ((z).imag)
#endif #endif
#if defined(_WIN32) && defined(__cplusplus) && CYTHON_CCOMPLEX #if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
#define __Pyx_SET_CREAL(z,x) ((z).real(x)) #define __Pyx_SET_CREAL(z,x) ((z).real(x))
#define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else #else
...@@ -2952,7 +2952,7 @@ class CppClassType(CType): ...@@ -2952,7 +2952,7 @@ class CppClassType(CType):
has_attributes = 1 has_attributes = 1
exception_check = True exception_check = True
namespace = None namespace = None
# For struct-like declaration. # For struct-like declaration.
kind = "struct" kind = "struct"
packed = False packed = False
...@@ -2973,7 +2973,7 @@ class CppClassType(CType): ...@@ -2973,7 +2973,7 @@ class CppClassType(CType):
def use_conversion_utility(self, from_or_to): def use_conversion_utility(self, from_or_to):
pass pass
def create_from_py_utility_code(self, env): def create_from_py_utility_code(self, env):
if self.from_py_function is not None: if self.from_py_function is not None:
return True return True
...@@ -3010,7 +3010,7 @@ class CppClassType(CType): ...@@ -3010,7 +3010,7 @@ class CppClassType(CType):
env.use_utility_code(CythonUtilityCode.load(cls + ".from_py", "CppConvert.pyx", context=context)) env.use_utility_code(CythonUtilityCode.load(cls + ".from_py", "CppConvert.pyx", context=context))
self.from_py_function = cname self.from_py_function = cname
return True return True
def create_to_py_utility_code(self, env): def create_to_py_utility_code(self, env):
if self.to_py_function is not None: if self.to_py_function is not None:
return True return True
......
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