Commit 2826c424 authored by Robert Bradshaw's avatar Robert Bradshaw

Step towards fixing #252

parent 926ad54d
...@@ -550,8 +550,7 @@ class CFuncDeclaratorNode(CDeclaratorNode): ...@@ -550,8 +550,7 @@ class CFuncDeclaratorNode(CDeclaratorNode):
if self.optional_arg_count: if self.optional_arg_count:
scope = StructOrUnionScope() scope = StructOrUnionScope()
arg_count_member = '%sn' % Naming.pyrex_prefix arg_count_member = '%sn' % Naming.pyrex_prefix
scope.declare_var(arg_count_member, PyrexTypes.c_int_type, self.pos, scope.declare_var(arg_count_member, PyrexTypes.c_int_type, self.pos)
cname = arg_count_member)
for arg in func_type_args[len(func_type_args)-self.optional_arg_count:]: 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) scope.declare_var(arg.name, arg.type, arg.pos, allow_pyobject = 1)
struct_cname = env.mangle(Naming.opt_arg_prefix, self.base.name) struct_cname = env.mangle(Naming.opt_arg_prefix, self.base.name)
......
...@@ -32,7 +32,7 @@ ansi_c_keywords = set( ...@@ -32,7 +32,7 @@ ansi_c_keywords = set(
def c_safe_identifier(cname): def c_safe_identifier(cname):
# There are some C limitations on struct entry names. # 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 cname = Naming.pyrex_prefix + cname
return cname return cname
......
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