From: W. Trevor King Date: Thu, 3 Mar 2011 13:28:17 +0000 (-0500) Subject: Convert CTypeDefNode to use explicit visibilities. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c907caab33e9273447710de5d92e9eaeea2896ad;p=cython.git Convert CTypeDefNode to use explicit visibilities. --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index edd0f4db..b4730bc0 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -1157,10 +1157,12 @@ class CTypeDefNode(StatNode): def analyse_declarations(self, env): base = self.base_type.analyse(env) name_declarator, type = self.declarator.analyse(base, env) - name = name_declarator.name - cname = name_declarator.cname - entry = env.declare_typedef(name, type, self.pos, - cname = cname, visibility = self.visibility) + binding = Binding() + binding.pull(self) + binding.name = name_declarator.name + binding.cname = name_declarator.cname + entry = env.WTK_declare_typedef( + binding, base_type = type, pos = self.pos) if self.in_pxd and not env.in_cinclude: entry.defined_in_pxd = 1 diff --git a/Cython/Compiler/Parsing.py b/Cython/Compiler/Parsing.py index a8967d91..c969dbe2 100644 --- a/Cython/Compiler/Parsing.py +++ b/Cython/Compiler/Parsing.py @@ -2775,14 +2775,10 @@ def p_ctypedef_statement(s, pos, ctx): s.error("Syntax error in ctypedef statement") declarator = p_c_declarator(s, ctx, is_type = 1, nonempty = 1) s.expect_newline("Syntax error in ctypedef statement") - visibility = 'private' - if ctx.extern: - visibility = 'extern' - elif ctx.c_visibility != 'private': - visibility = ctx.c_visibility return Nodes.CTypeDefNode( - pos, base_type = base_type, - declarator = declarator, visibility = visibility, + pos, base_type = base_type, declarator = declarator, + extern = ctx.extern, visibility = ctx.visibility, + c_visibility = ctx.c_visibility, in_pxd = ctx.level == 'module_pxd') def p_decorators(s):