[vala/staging] girwriter: Fix position of priv field (--abi-stability)
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] girwriter: Fix position of priv field (--abi-stability)
- Date: Fri, 1 Nov 2019 16:23:42 +0000 (UTC)
commit 7cb3a3f00dcbadded394a6cb9b7042b7d627bea8
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Wed Oct 16 11:48:44 2019 +0200
girwriter: Fix position of priv field (--abi-stability)
See https://gitlab.gnome.org/GNOME/vala/issues/850
codegen/valagirwriter.vala | 29 +++++++++++++++++++++--------
1 file changed, 21 insertions(+), 8 deletions(-)
---
diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala
index a8b339a3a..c30384d38 100644
--- a/codegen/valagirwriter.vala
+++ b/codegen/valagirwriter.vala
@@ -450,14 +450,16 @@ public class Vala.GIRWriter : CodeVisitor {
buffer.append_printf("</field>\n");
}
- write_indent ();
- buffer.append_printf ("<field name=\"priv\" readable=\"0\" private=\"1\">\n");
- indent++;
- write_indent ();
- buffer.append_printf ("<type name=\"%sPrivate\" c:type=\"%sPrivate*\"/>\n",
get_gir_name (cl), get_ccode_name (cl));
- indent--;
- write_indent ();
- buffer.append_printf("</field>\n");
+ if (!context.abi_stability) {
+ write_indent ();
+ buffer.append_printf ("<field name=\"priv\" readable=\"0\" private=\"1\">\n");
+ indent++;
+ write_indent ();
+ buffer.append_printf ("<type name=\"%sPrivate\" c:type=\"%sPrivate*\"/>\n",
get_gir_name (cl), get_ccode_name (cl));
+ indent--;
+ write_indent ();
+ buffer.append_printf("</field>\n");
+ }
if (cl.base_class != null && cl.base_class.is_subtype_of (gobject_type)) {
foreach (var p in cl.get_type_parameters ()) {
@@ -469,6 +471,17 @@ public class Vala.GIRWriter : CodeVisitor {
cl.accept_children (this);
hierarchy.remove_at (0);
+ if (context.abi_stability) {
+ write_indent ();
+ buffer.append_printf ("<field name=\"priv\" readable=\"0\" private=\"1\">\n");
+ indent++;
+ write_indent ();
+ buffer.append_printf ("<type name=\"%sPrivate\" c:type=\"%sPrivate*\"/>\n",
get_gir_name (cl), get_ccode_name (cl));
+ indent--;
+ write_indent ();
+ buffer.append_printf("</field>\n");
+ }
+
indent--;
write_indent ();
buffer.append_printf ("</class>\n");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]