summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2017-02-28 18:40:59 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2017-03-01 09:41:30 +0100
commitf97ec8601f747ea0005be7bb374790ef24092e0a (patch)
tree9cd5e99c6ce9efd1bd532602010d367cb09fdc6e
parent34d2da0ef6d81c440ac86e07e36c7c8baf296ed2 (diff)
downloadvala-f97ec8601f747ea0005be7bb374790ef24092e0a.tar.gz
codegen: Default to void-return for vfunc pointer cast of *_async methods
This make it match vala's generated code of async-module. To properly account for non-void *_async methods we require some additional metadata since only the return-type of *_finish method is known.
-rw-r--r--codegen/valagtypemodule.vala2
1 files changed, 1 insertions, 1 deletions
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
index 0398163cc..1e1b9e30a 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -1489,7 +1489,7 @@ public class Vala.GTypeModule : GErrorModule {
CCodeExpression cast_method_pointer (Method m, CCodeExpression cfunc, ObjectTypeSymbol base_type, int direction = 3) {
// Cast the function pointer to match the interface
string cast;
- if (m.return_type.is_real_non_null_struct_type ()) {
+ if (direction == 1 || m.return_type.is_real_non_null_struct_type ()) {
cast = "void (*)";
} else {
cast = get_ccode_name (m.return_type) + " (*)";