Skip to content

Commit

Permalink
Merge pull request #40 from KoolieAid/main
Browse files Browse the repository at this point in the history
Function pointer parameters now has names
  • Loading branch information
neuecc authored Sep 4, 2023
2 parents 29c496f + 737bbd1 commit fe5b83c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions csbindgen/src/type_meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,15 +442,20 @@ pub fn build_method_delegate_if_required(

let joined_param = parameters
.iter()
.map(|p| {
.enumerate()
.map(|(index, p)| {
let cs = p.rust_type.to_csharp_string(
options,
alias_map,
emit_from_struct,
method_name,
parameter_name,
);
format!("{} {}", cs, escape_name(p.name.as_str()))
// a is ascii for 97
let parameter_name = char::from_u32(index as u32 + 97)
.unwrap_or('?')
.to_string();
format!("{} {}", cs, escape_name(parameter_name.as_str()))
})
.collect::<Vec<_>>()
.join(", ");
Expand Down

0 comments on commit fe5b83c

Please sign in to comment.