diff options
author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2020-01-02 18:02:45 +0100 |
---|---|---|
committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2020-01-02 18:02:48 +0100 |
commit | f3aa793ba33dba4e4624232e8d144ad0c697520f (patch) | |
tree | e0d330b10b222b7761485511bb94e9f294a2bee6 /modules | |
parent | 1c88ee6c9695efb783eb9e6e9225288f3c50eab1 (diff) |
Mono/C#: Fix bindings generator with void vararg methods
Commit 4d727f1ee6b970298a7c1752ba19b49d7060c405 made it possible for vararg
methods to return void. This broke the C# bindings generator which was
assuming in one place that vararg methods always return Variant.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/mono/editor/bindings_generator.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index cb5802181b..0557d44a02 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -2066,9 +2066,11 @@ Error BindingsGenerator::_generate_glue_method(const BindingsGenerator::TypeInte p_output.append(p_imethod.arguments.size() ? C_LOCAL_PTRCALL_ARGS ".ptr()" : "NULL"); p_output.append(", total_length, vcall_error);\n"); - // See the comment on the C_LOCAL_VARARG_RET declaration - if (return_type->cname != name_cache.type_Variant) { - p_output.append("\t" C_LOCAL_RET " = " C_LOCAL_VARARG_RET ";\n"); + if (!ret_void) { + // See the comment on the C_LOCAL_VARARG_RET declaration + if (return_type->cname != name_cache.type_Variant) { + p_output.append("\t" C_LOCAL_RET " = " C_LOCAL_VARARG_RET ";\n"); + } } } else { p_output.append("\t" CS_PARAM_METHODBIND "->ptrcall(" CS_PARAM_INSTANCE ", "); |