Commit 2a785d75 authored by Robert Bradshaw's avatar Robert Bradshaw

merge

parents 882d16d1 69257409
...@@ -13,7 +13,7 @@ class CythonScope(ModuleScope): ...@@ -13,7 +13,7 @@ class CythonScope(ModuleScope):
self.shape_entry = self.declare_cfunction('shape', self.shape_entry = self.declare_cfunction('shape',
shape_func_type, shape_func_type,
pos=None, pos=None,
visibility='public', visibility='extern',
cname='<error>') cname='<error>')
def create_cython_scope(context): def create_cython_scope(context):
......
...@@ -533,9 +533,7 @@ def p_name(s, name): ...@@ -533,9 +533,7 @@ def p_name(s, name):
return ExprNodes.IntNode(pos, value = rep, longness = "L") return ExprNodes.IntNode(pos, value = rep, longness = "L")
elif isinstance(value, float): elif isinstance(value, float):
return ExprNodes.FloatNode(pos, value = rep) return ExprNodes.FloatNode(pos, value = rep)
elif isinstance(value, unicode): elif isinstance(value, (str, unicode)):
return ExprNodes.StringNode(pos, value = value)
elif isinstance(value, str):
return ExprNodes.StringNode(pos, value = value) return ExprNodes.StringNode(pos, value = value)
else: else:
error(pos, "Invalid type for compile-time constant: %s" error(pos, "Invalid type for compile-time constant: %s"
......
...@@ -440,7 +440,7 @@ class Scope: ...@@ -440,7 +440,7 @@ class Scope:
if api: if api:
entry.api = 1 entry.api = 1
if not defining and not in_pxd and visibility != 'extern': if not defining and not in_pxd and visibility != 'extern':
error(pos, "Non-extern C function declared but not defined") error(pos, "Non-extern C function '%s' declared but not defined" % name)
return entry return entry
def add_cfunction(self, name, type, pos, cname, visibility): def add_cfunction(self, name, type, pos, cname, visibility):
...@@ -686,7 +686,7 @@ class BuiltinScope(Scope): ...@@ -686,7 +686,7 @@ class BuiltinScope(Scope):
# If python_equiv == "*", the Python equivalent has the same name # If python_equiv == "*", the Python equivalent has the same name
# as the entry, otherwise it has the name specified by python_equiv. # as the entry, otherwise it has the name specified by python_equiv.
name = EncodedString(name) name = EncodedString(name)
entry = self.declare_cfunction(name, type, None, cname) entry = self.declare_cfunction(name, type, None, cname, visibility='extern')
entry.utility_code = utility_code entry.utility_code = utility_code
if python_equiv: if python_equiv:
if python_equiv == "*": if python_equiv == "*":
......
__doc__ = u"""
>>> call2()
>>> call3()
>>> call4()
"""
# the calls:
def call2():
b(1,2)
def call3():
b(1,2,3)
def call4():
b(1,2,3,4)
# the called function:
cdef b(a, b, c=1, d=2):
pass
# this will be included
D = 2 D = 2
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment