csbindgen
csbindgen copied to clipboard
Support for macro_rules! generated functions in csbindgen
Problem Description
csbindgen currently cannot recognize functions generated through macro_rules! macros, preventing these functions from being included in the generated C# binding code.
- Manually written functions with #[unsafe(no_mangle)] attributes are correctly recognized and generated
- Functions generated through macro_rules! macros (even with the same attributes) cannot be recognized
- Generated C# binding files are missing numerous functions generated by macros
Environment Information
csbindgen version: 1.9.5 Rust version: 2024 edition
Since it's based on AST analysis, I think it would be difficult to process macros.
There is the unstable -Zunpretty=expanded which could be used to obtain code with macros already expanded and then csbindgen could analyses that.