From a7b546537d8bb492fdd7d96ac24e1feb102857a0 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Tue, 21 Oct 2008 18:06:01 -0700 Subject: [PATCH] handle visibility propagation --- Cython/Compiler/ModuleNode.py | 2 ++ Cython/Compiler/Nodes.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 4c76c259..c36cc3be 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -766,6 +766,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): dll_linkage = dll_linkage) if entry.visibility == 'private': storage_class = "static " + elif entry.visibility == 'public': + storage_class = "" else: storage_class = "%s " % Naming.extern_c_macro code.putln("%s%s; /*proto*/" % ( diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 691e1ccf..bb805314 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -1299,8 +1299,10 @@ class CFuncDefNode(FuncDefNode): dll_linkage = None header = self.return_type.declaration_code(entity, dll_linkage = dll_linkage) - if visibility != 'private': + if visibility == 'extern': storage_class = "%s " % Naming.extern_c_macro + elif visibility == 'public': + storage_class = "" else: storage_class = "static " code.putln("%s%s %s {" % ( -- 2.26.2