[vala] GAsync: Fix virtual async methods returning structs
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] GAsync: Fix virtual async methods returning structs
- Date: Wed, 16 Jun 2010 18:37:32 +0000 (UTC)
commit 71957e0c2438fa559165ea6ac3f5f875d6a438a6
Author: Jürg Billeter <j bitron ch>
Date: Wed Jun 16 20:35:31 2010 +0200
GAsync: Fix virtual async methods returning structs
Fixes bug 621768.
codegen/valagasyncmodule.vala | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valagasyncmodule.vala b/codegen/valagasyncmodule.vala
index 5068745..508bac5 100644
--- a/codegen/valagasyncmodule.vala
+++ b/codegen/valagasyncmodule.vala
@@ -517,6 +517,12 @@ public class Vala.GAsyncModule : GSignalModule {
return;
}
+ var creturn_type = m.return_type;
+ if (m.return_type.is_real_non_null_struct_type ()) {
+ // structs are returned via out parameter
+ creturn_type = new VoidType ();
+ }
+
// add vfunc field to the type struct
var vdeclarator = new CCodeFunctionDeclarator (m.vfunc_name);
var cparam_map = new HashMap<int,CCodeFormalParameter> (direct_hash, direct_equal);
@@ -533,7 +539,7 @@ public class Vala.GAsyncModule : GSignalModule {
generate_cparameters (m, decl_space, cparam_map, new CCodeFunction ("fake"), vdeclarator, null, null, 2);
- vdecl = new CCodeDeclaration (m.return_type.get_cname ());
+ vdecl = new CCodeDeclaration (creturn_type.get_cname ());
vdecl.add_declarator (vdeclarator);
type_struct.add_declaration (vdecl);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]