From: Rico Tzschichholz Date: Tue, 11 Dec 2018 14:16:09 +0000 (+0100) Subject: codegen: GType classes require including "glib-object.h" X-Git-Tag: 0.43.2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab5d5765c0b72c6ead77e3f03f0876f63773b26f;p=thirdparty%2Fvala.git codegen: GType classes require including "glib-object.h" Move the include at a better position to cover more cases. --- diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala index 55ad7f3fd..bb971c1c4 100644 --- a/codegen/valagtypemodule.vala +++ b/codegen/valagtypemodule.vala @@ -66,6 +66,8 @@ public class Vala.GTypeModule : GErrorModule { bool is_gsource = cl.base_class == gsource_type; if (is_gtypeinstance) { + decl_space.add_include ("glib-object.h"); + decl_space.add_type_declaration (new CCodeNewline ()); var macro = "(%s_get_type ())".printf (get_ccode_lower_case_name (cl, null)); decl_space.add_type_declaration (new CCodeMacroReplacement (get_ccode_type_id (cl), macro)); @@ -234,7 +236,6 @@ public class Vala.GTypeModule : GErrorModule { if (cl.base_class != null) { instance_struct.add_field (get_ccode_name (cl.base_class), "parent_instance"); } else if (is_fundamental) { - decl_space.add_include ("glib-object.h"); instance_struct.add_field ("GTypeInstance", "parent_instance"); instance_struct.add_field ("volatile int", "ref_count"); }