-
-
Save robertwb/ddce00931e24540b64db27b9464a162d to your computer and use it in GitHub Desktop.
Attachment declare_const.patch for http://trac.cython.org/ticket/185
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# HG changeset patch | |
# User Jason Evans <jasone@canonware.com> | |
# Date 1232168582 28800 | |
# Node ID 18643350b1c548c9ec5cdd0721446ddd5c877b9d | |
# Parent 682a2248596fd367913d0c67d2fbd762d5226606 | |
Do not mangle enum constant names if the enum is public. | |
diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py | |
--- a/Cython/Compiler/Symtab.py | |
+++ b/Cython/Compiler/Symtab.py | |
@@ -303,7 +303,7 @@ | |
def declare_const(self, name, type, value, pos, cname = None, visibility = 'private'): | |
# Add an entry for a named constant. | |
if not cname: | |
- if self.in_cinclude: | |
+ if self.in_cinclude or visibility == 'public': | |
cname = name | |
else: | |
cname = self.mangle(Naming.enum_prefix, name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment