From: Luca Bruno Date: Tue, 6 Sep 2011 09:58:11 +0000 (+0200) Subject: codegen: Fix determining the default cheaders of symbols X-Git-Tag: 0.13.4~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=091fae4e20802d66726c61d6410b1645832d7670;p=thirdparty%2Fvala.git codegen: Fix determining the default cheaders of symbols Fixes a regression introduced by the attributes refactoring. The refactoring missed a check on the cheaders of the parent symbol. Fixes bug 658338. --- diff --git a/codegen/valaccodeattribute.vala b/codegen/valaccodeattribute.vala index 48277d90c..cf7ce891d 100644 --- a/codegen/valaccodeattribute.vala +++ b/codegen/valaccodeattribute.vala @@ -668,9 +668,14 @@ public class Vala.CCodeAttribute : AttributeCache { private string get_default_header_filenames () { if (sym is DynamicProperty || sym is DynamicMethod) { return ""; - } else if (sym.parent_symbol != null) { - return CCodeBaseModule.get_ccode_header_filenames (sym.parent_symbol); - } else if (sym.source_reference != null && !sym.external_package) { + } + if (sym.parent_symbol != null) { + var parent_headers = CCodeBaseModule.get_ccode_header_filenames (sym.parent_symbol); + if (parent_headers.length > 0) { + return parent_headers; + } + } + if (sym.source_reference != null && !sym.external_package) { // don't add default include directives for VAPI files return sym.source_reference.file.get_cinclude_filename (); }