2006-10-26 Jürg Billeter <j@bitron.ch>
+ * vala/valacodegenerator.vala: don't create empty dispose functions,
+ support virtual methods with non-void return type
+ * vapi/glib-2.0.vala: include glib/gstdio.h for GLib file functions
+
+2006-10-26 Jürg Billeter <j@bitron.ch>
+
* vala/valacodegenerator.vala: explicitly cast callbacks to reduce the
number of warnings during C compilation
}
add_instance_init_function (cl);
- if (memory_management) {
+ if (memory_management && cl.get_fields () != null) {
add_dispose_function (cl);
}
vcall.add_argument (new CCodeIdentifier (param.name));
}
- vblock.add_statement (new CCodeExpressionStatement (vcall));
+ if (m.return_type.data_type == null) {
+ vblock.add_statement (new CCodeExpressionStatement (vcall));
+ } else {
+ /* pass method return value */
+ vblock.add_statement (new CCodeReturnStatement (vcall));
+ }
header_type_member_declaration.append (vfunc.copy ());
}
[ReferenceType (free_function = "fclose")]
- [CCode (cname = "FILE", cheader_filename = "stdio.h")]
+ [CCode (cname = "FILE", cheader_filename = "stdio.h,glib/gstdio.h")]
public struct File {
[CCode (cname = "fopen")]
public static ref File open (string path, string mode);