Skip to content

Commit

Permalink
Also generate ROS overload for vararg methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Delsin-Yu committed Oct 7, 2024
1 parent dedddee commit 06ade5f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions modules/mono/editor/bindings_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2686,6 +2686,10 @@ Error BindingsGenerator::_generate_cs_method(const BindingsGenerator::TypeInterf
break;
}
}

if(p_imethod.is_vararg){
has_span_argument = true;
}
}

if (p_use_span && has_span_argument) {
Expand Down Expand Up @@ -4593,13 +4597,14 @@ void BindingsGenerator::_populate_builtin_type_interfaces() {
itype = TypeInterface();
itype.name = "VarArg";
itype.cname = itype.name;
itype.proxy_name = "Variant[]";
itype.proxy_name = "ReadOnlySpan<Variant>";
itype.cs_type = "params Variant[]";
itype.cs_in_expr = "%0 ?? Array.Empty<Variant>()";
itype.cs_in_expr = "%0";
// c_type, c_in and c_arg_in are hard-coded in the generator.
// c_out and c_type_out are not applicable to VarArg.
itype.c_arg_in = "&%s_in";
itype.c_type_in = "Variant[]";
itype.c_type_in = "ReadOnlySpan<Variant>";
itype.is_span_compatible = true;
builtin_types.insert(itype.cname, itype);

#define INSERT_ARRAY_FULL(m_name, m_type, m_managed_type, m_proxy_t) \
Expand Down

0 comments on commit 06ade5f

Please sign in to comment.