From 2c104e675ece92bd89ec032593fe52f7ec695919 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Wed, 29 Oct 2014 23:32:08 -0700 Subject: Only define used ctuples. --- Cython/Compiler/ModuleNode.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Cython/Compiler/ModuleNode.py') diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 4e7a38a1c..560acc1b8 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -721,6 +721,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): pass elif type.is_struct_or_union or type.is_cpp_class: self.generate_struct_union_predeclaration(entry, code) + elif type.is_ctuple and entry.used: + self.generate_struct_union_predeclaration(entry.type.struct_entry, code) elif type.is_extension_type: self.generate_objstruct_predeclaration(type, code) # Actual declarations @@ -734,6 +736,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): self.generate_enum_definition(entry, code) elif type.is_struct_or_union: self.generate_struct_union_definition(entry, code) + elif type.is_ctuple and entry.used: + self.generate_struct_union_definition(entry.type.struct_entry, code) elif type.is_cpp_class: self.generate_cpp_class_definition(entry, code) elif type.is_extension_type: -- cgit v1.2.1