From a17037a256f832ecef67a7134e8d99bee138835a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrg=20Billeter?= Date: Sun, 10 Jan 2010 20:49:06 +0100 Subject: [PATCH] Write has_type_id attribute for structs in VAPI files MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Make sure we don't lose has_type_id if it's false. Based on patch by Marc-André Lureau, fixes bug 606580. --- vala/valacodewriter.vala | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/vala/valacodewriter.vala b/vala/valacodewriter.vala index e6dd8828f..a23f05f99 100644 --- a/vala/valacodewriter.vala +++ b/vala/valacodewriter.vala @@ -320,17 +320,19 @@ public class Vala.CodeWriter : CodeVisitor { write_string ("cname = \"%s\", ".printf (st.get_cname ())); } - if (!st.is_simple_type () && st.get_type_id () != "G_TYPE_POINTER") { + if (!st.has_type_id) { + write_string ("has_type_id = false"); + } else if (!st.is_simple_type () && st.get_type_id () != "G_TYPE_POINTER") { write_string ("type_id = \"%s\", ".printf (st.get_type_id ())); } - if (!st.has_copy_function) { - write_string ("has_copy_function = false, "); - } + if (!st.has_copy_function) { + write_string ("has_copy_function = false, "); + } - if (!st.has_destroy_function) { - write_string ("has_destroy_function = false, "); - } + if (!st.has_destroy_function) { + write_string ("has_destroy_function = false, "); + } write_string ("cheader_filename = \"%s\")]".printf (get_cheaders(st))); write_newline (); @@ -470,7 +472,7 @@ public class Vala.CodeWriter : CodeVisitor { write_string ("[CCode (cprefix = \"%s\", ".printf (en.get_cprefix ())); if (!en.has_type_id) { - write_string ("has_type_id = \"%d\", ".printf (en.has_type_id ? 1 : 0)); + write_string ("has_type_id = false"); } write_string ("cheader_filename = \"%s\")]".printf (get_cheaders(en))); -- 2.47.3