handle visibility propagation
authorRobert Bradshaw <robertwb@math.washington.edu>
Wed, 22 Oct 2008 01:06:01 +0000 (18:06 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Wed, 22 Oct 2008 01:06:01 +0000 (18:06 -0700)
Cython/Compiler/ModuleNode.py
Cython/Compiler/Nodes.py

index 4c76c25973e9f2676cd303b75e337933473a5087..c36cc3be52aeb4b0c81dafeba864513ad0e1aae1 100644 (file)
@@ -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*/" % (
index 691e1ccfd42474f85afe638f027ff0c22d4b7bf1..bb80531415386f52fb1f658349f3aa732de6225d 100644 (file)
@@ -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 {" % (