From 7cdfd770c17aff45aa212cb69eb181da853ac814 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Sat, 29 Jan 2011 01:25:51 -0800 Subject: [PATCH] Allow extern "functions" (e.g. macros) to return array types. --- Cython/Compiler/Nodes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 35d2b88a..9251e018 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -607,9 +607,6 @@ class CFuncDeclaratorNode(CDeclaratorNode): error(self.exception_value.pos, "Exception value incompatible with function return type") exc_check = self.exception_check - if return_type.is_array: - error(self.pos, - "Function cannot return an array") if return_type.is_cfunction: error(self.pos, "Function cannot return a function") @@ -1656,6 +1653,9 @@ class CFuncDefNode(FuncDefNode): api = self.api, modifiers = self.modifiers) self.entry.inline_func_in_pxd = self.inline_in_pxd self.return_type = type.return_type + if self.return_type.is_array and visibility != 'extern': + error(self.pos, + "Function cannot return an array") if self.overridable and not env.is_module_scope: if len(self.args) < 1 or not self.args[0].type.is_pyobject: -- 2.26.2