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.
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 = "%s (*)".printf (get_ccode_name (m.return_type));