From: Jürg Billeter Date: Sun, 10 Jan 2010 19:49:06 +0000 (+0100) Subject: Write has_type_id attribute for structs in VAPI files X-Git-Tag: 0.7.10~85 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a17037a256f832ecef67a7134e8d99bee138835a;p=thirdparty%2Fvala.git Write has_type_id attribute for structs in VAPI files Make sure we don't lose has_type_id if it's false. Based on patch by Marc-André Lureau, fixes bug 606580. --- 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)));