diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2017-02-28 18:40:59 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2017-03-01 09:41:30 +0100 |
commit | f97ec8601f747ea0005be7bb374790ef24092e0a (patch) | |
tree | 9cd5e99c6ce9efd1bd532602010d367cb09fdc6e | |
parent | 34d2da0ef6d81c440ac86e07e36c7c8baf296ed2 (diff) | |
download | vala-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.vala | 2 |
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) + " (*)"; |