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

codegen/valagirwriter.vala

index c5bec0fce9d9a592a1131c85e601bf09882ca9c3..7a0191b72365e69a754ff9668d85ce70993e698c 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);
 
@@ -554,7 +556,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), get_ccode_name (gtypeinterface_type));
                indent--;
                write_indent ();
                buffer.append_printf ("</field>\n");