[vala/0.52] girwriter: Write missing c:type attribute of compact class record



commit 7c2b4f65f7dfbed1b02c6ccfb42a9bc1824382d9
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Aug 10 14:03:08 2021 +0200

    girwriter: Write missing c:type attribute of compact class record
    
    Thanks to Niels De Graef

 codegen/valagirwriter.vala               | 1 +
 tests/girwriter/GirTest-1.0.gir-expected | 4 ++--
 tests/girwriter/girtest.vapigen-expected | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala
index 07b6f1e4c..523d9c505 100644
--- a/codegen/valagirwriter.vala
+++ b/codegen/valagirwriter.vala
@@ -606,6 +606,7 @@ public class Vala.GIRWriter : CodeVisitor {
                } else {
                        write_indent ();
                        buffer.append_printf ("<record name=\"%s\"", get_gir_name (cl));
+                       write_ctype_attributes (cl);
                        write_symbol_attributes (cl);
                        buffer.append_printf (">\n");
                        indent++;
diff --git a/tests/girwriter/GirTest-1.0.gir-expected b/tests/girwriter/GirTest-1.0.gir-expected
index 52f97ab53..d7f9b8507 100644
--- a/tests/girwriter/GirTest-1.0.gir-expected
+++ b/tests/girwriter/GirTest-1.0.gir-expected
@@ -1811,7 +1811,7 @@
                </field>
        </record>
        <record name="ImplementionTestPrivate" c:type="GirTestImplementionTestPrivate" disguised="1"/>
-       <record name="CompactClass">
+       <record name="CompactClass" c:type="GirTestCompactClass">
                <field name="s" writable="1">
                        <type name="utf8" c:type="gchar*"/>
                </field>
@@ -1890,7 +1890,7 @@
                </field>
        </record>
        <record name="RenamedClassPrivate" c:type="GirTestNamedClassPrivate" disguised="1"/>
-       <record name="RenamedCompactClass">
+       <record name="RenamedCompactClass" c:type="GirTestNamedCompactClass">
                <field name="s" writable="1">
                        <type name="utf8" c:type="gchar*"/>
                </field>
diff --git a/tests/girwriter/girtest.vapigen-expected b/tests/girwriter/girtest.vapigen-expected
index 9287919f8..fa4eae1fd 100644
--- a/tests/girwriter/girtest.vapigen-expected
+++ b/tests/girwriter/girtest.vapigen-expected
@@ -199,7 +199,7 @@ namespace GirTest {
                public int internal_field_name;
                public void inv ();
        }
-       [CCode (cheader_filename = "girtest.h", has_type_id = false)]
+       [CCode (cheader_filename = "girtest.h", cname = "GirTestNamedCompactClass", has_type_id = false)]
        public struct RenamedCompactClass {
                public weak string s;
                public int i;


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