summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2007-01-19 06:42:22 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2007-01-19 06:42:22 (GMT)
commit4885e7d09833bbacbfcfc6d9df8488ccb87e8eb8 (patch)
tree353950f22d1b86b456d1d5592af1690611ed5583 /Parser
parenta6c0b598141310a92c7b6fb7111365f9fd457086 (diff)
downloadcpython-4885e7d09833bbacbfcfc6d9df8488ccb87e8eb8.zip
cpython-4885e7d09833bbacbfcfc6d9df8488ccb87e8eb8.tar.gz
cpython-4885e7d09833bbacbfcfc6d9df8488ccb87e8eb8.tar.bz2
Prefix AST symbols with _Py_. Fixes #1637022.
Will backport.
Diffstat (limited to 'Parser')
-rwxr-xr-xParser/asdl_c.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index b6d9830..4d330a3 100755
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -260,7 +260,12 @@ class PrototypeVisitor(EmitVisitor):
argstr += ", PyArena *arena"
else:
argstr = "PyArena *arena"
- self.emit("%s %s(%s);" % (ctype, name, argstr), 0)
+ margs = "a0"
+ for i in range(1, len(args)+1):
+ margs += ", a%d" % i
+ self.emit("#define %s(%s) _Py_%s(%s)" % (name, margs, name, margs), 0,
+ reflow = 0)
+ self.emit("%s _Py_%s(%s);" % (ctype, name, argstr), 0)
def visitProduct(self, prod, name):
self.emit_function(name, get_c_type(name),