From: Robert Bradshaw Date: Fri, 27 Mar 2009 11:26:32 +0000 (-0700) Subject: Step towards fixing #252 X-Git-Tag: 0.12.alpha0~334^2~13 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2826c4248ca8ea1b837f087d00badc1ddb151f3c;p=cython.git Step towards fixing #252 --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 0de02d97..ce6a1af0 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -550,8 +550,7 @@ class CFuncDeclaratorNode(CDeclaratorNode): if self.optional_arg_count: scope = StructOrUnionScope() arg_count_member = '%sn' % Naming.pyrex_prefix - scope.declare_var(arg_count_member, PyrexTypes.c_int_type, self.pos, - cname = arg_count_member) + scope.declare_var(arg_count_member, PyrexTypes.c_int_type, self.pos) for arg in func_type_args[len(func_type_args)-self.optional_arg_count:]: scope.declare_var(arg.name, arg.type, arg.pos, allow_pyobject = 1) struct_cname = env.mangle(Naming.opt_arg_prefix, self.base.name) diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py index 6636dd1b..53e93057 100644 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@ -32,7 +32,7 @@ ansi_c_keywords = set( def c_safe_identifier(cname): # There are some C limitations on struct entry names. - if cname[:2] == '__' or cname in ansi_c_keywords: + if (cname[:2] == '__' and not cname.startswith(Naming.pyrex_prefix)) or cname in ansi_c_keywords: cname = Naming.pyrex_prefix + cname return cname