[vala/staging] codegen: GType classes require including "glib-object.h"



commit ab5d5765c0b72c6ead77e3f03f0876f63773b26f
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Dec 11 15:16:09 2018 +0100

    codegen: GType classes require including "glib-object.h"
    
    Move the include at a better position to cover more cases.

 codegen/valagtypemodule.vala | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
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");
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]