]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Fix determining the default cheaders of symbols
authorLuca Bruno <lucabru@src.gnome.org>
Tue, 6 Sep 2011 09:58:11 +0000 (11:58 +0200)
committerLuca Bruno <lucabru@src.gnome.org>
Tue, 6 Sep 2011 10:23:44 +0000 (12:23 +0200)
Fixes a regression introduced by the attributes refactoring.
The refactoring missed a check on the cheaders of the parent symbol.

Fixes bug 658338.

codegen/valaccodeattribute.vala

index 48277d90ca7c52bd010687f552d3b663475553b7..cf7ce891da6b764725fc3ee68966ef7bc43fd2f6 100644 (file)
@@ -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 ();
                }