]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girwriter: Properly resolve GLib.TypeInterface instead of hardcoding it
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 27 Apr 2019 09:17:28 +0000 (11:17 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 6 Aug 2019 11:36:32 +0000 (13:36 +0200)
This makes sure to pick up the dependency on GObject-2.0.gir

codegen/valagirwriter.vala

index e3745b09a8822792864babd9af17cbabd14b4e26..17db206451a5f452781afd3610549ea816169f2f 100644 (file)
@@ -111,6 +111,7 @@ public class Vala.GIRWriter : CodeVisitor {
 
        private TypeSymbol gobject_type;
        private TypeSymbol ginitiallyunowned_type;
+       private TypeSymbol gtypeinterface_type;
 
        private struct GIRNamespace {
                public GIRNamespace (string ns, string version) {
@@ -153,6 +154,7 @@ public class Vala.GIRWriter : CodeVisitor {
                var glib_ns = root_symbol.scope.lookup ("GLib");
                gobject_type = (TypeSymbol) glib_ns.scope.lookup ("Object");
                ginitiallyunowned_type = (TypeSymbol) glib_ns.scope.lookup ("InitiallyUnowned");
+               gtypeinterface_type = (TypeSymbol) glib_ns.scope.lookup ("TypeInterface");
 
                write_package (package);
 
@@ -551,7 +553,7 @@ public class Vala.GIRWriter : CodeVisitor {
                buffer.append_printf ("<field name=\"parent_iface\">\n");
                indent++;
                write_indent ();
-               buffer.append_printf ("<type name=\"GObject.TypeInterface\" c:type=\"GTypeInterface\"/>\n");
+               buffer.append_printf ("<type name=\"%s\" c:type=\"%s\"/>\n", gi_type_name (gtypeinterface_type), CCodeBaseModule.get_ccode_name (gtypeinterface_type));
                indent--;
                write_indent ();
                buffer.append_printf ("</field>\n");