From: Robert Bradshaw Date: Sun, 12 Dec 2010 04:52:24 +0000 (-0800) Subject: conjugate for other numeric types X-Git-Tag: 0.14.1rc0~13^2~37 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bb0c9225e096dcc625103c6ab8dabd6b3c9f047f;p=cython.git conjugate for other numeric types --- diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py index 43873df1..8d1ff54e 100755 --- a/Cython/Compiler/PyrexTypes.py +++ b/Cython/Compiler/PyrexTypes.py @@ -635,6 +635,8 @@ class CNumericType(CType): is_numeric = 1 default_value = "0" + has_attributes = True + scope = None sign_words = ("unsigned ", "", "signed ") @@ -658,6 +660,23 @@ class CNumericType(CType): else: base_code = public_decl(type_name, dll_linkage) return self.base_declaration_code(base_code, entity_code) + + def attributes_known(self): + if self.scope is None: + import Symtab + self.scope = scope = Symtab.CClassScope( + '', + None, + visibility="extern") + scope.parent_type = self + scope.directives = {} + entry = scope.declare_cfunction( + "conjugate", + CFuncType(self, [CFuncTypeArg("self", self, None)]), + pos=None, + defining=1, + cname=" ") + return True type_conversion_predeclarations = ""