darfink / detour-rs

A cross-platform detour library written in Rust
Other
389 stars 71 forks source link

Support trailing commas in function parameter lists #30

Open Kazurin-775 opened 2 years ago

Kazurin-775 commented 2 years ago

Currently, the following code does not work, leading to infinite recursion during macro expansion:

static_detour! {
    static Test: fn(i32,) -> i32;
}

However, it is legal for lists to have trailing commas in Rust:

type Test = fn(i32,) -> i32;

... and this is even recommended when the lists span across multiple lines. Therefore, this should be a nice-to-have feature.