From 6049280bd4a071359eeea3c7abfd6cf7d19c023a Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Wed, 8 Oct 2008 02:09:36 -0700 Subject: [PATCH] struct -> object for extern structs --- Cython/Compiler/PyrexTypes.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py index e22a7441..b6519df5 100644 --- a/Cython/Compiler/PyrexTypes.py +++ b/Cython/Compiler/PyrexTypes.py @@ -966,7 +966,13 @@ class CStructOrUnionType(CType): code.putln("Py_DECREF(res);") code.putln("return NULL;") code.putln("}") - self._convert_code = self.declaration_code('') + ';\n' + header+";", code.buffer.getvalue() + proto = header + ";" + # This is a bit of a hack, we need a forward declaration + # due to the way things are ordered in the module... + entry = env.lookup(self.name) + if entry.visibility != 'extern': + proto = self.declaration_code('') + ';\n' + proto + self._convert_code = proto, code.buffer.getvalue() env.use_utility_code(self._convert_code) return True -- 2.26.2