vala r1468 - in trunk: . gobject
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r1468 - in trunk: . gobject
- Date: Wed, 28 May 2008 19:35:06 +0000 (UTC)
Author: juergbi
Date: Wed May 28 19:35:06 2008
New Revision: 1468
URL: http://svn.gnome.org/viewvc/vala?rev=1468&view=rev
Log:
2008-05-28 Juerg Billeter <j bitron ch>
* gobject/valaccodeclassbinding.vala:
Ensure to not generate empty C structs,
patch by Jared Moore, fixes bug 533977
Modified:
trunk/ChangeLog
trunk/gobject/valaccodeclassbinding.vala
Modified: trunk/gobject/valaccodeclassbinding.vala
==============================================================================
--- trunk/gobject/valaccodeclassbinding.vala (original)
+++ trunk/gobject/valaccodeclassbinding.vala Wed May 28 19:35:06 2008
@@ -111,6 +111,11 @@
codegen.instance_struct.add_field ("volatile int", "ref_count");
}
+ if (cl.is_compact && cl.base_class == null && cl.get_fields ().size == 0) {
+ // add dummy member, C doesn't allow empty structs
+ codegen.instance_struct.add_field ("int", "dummy");
+ }
+
if (is_gtypeinstance) {
if (cl.source_reference.file.cycle == null) {
decl_frag.append (new CCodeTypeDefinition ("struct %s".printf (codegen.type_struct.name), new CCodeVariableDeclarator ("%sClass".printf (cl.get_cname ()))));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]