randomPoison / cs-bindgen

Experiment in using Rust to build a library that can be loaded by Unity across multiple platforms
4 stars 0 forks source link

Resolve type references when generating C# bindings #36

Closed randomPoison closed 4 years ago

randomPoison commented 4 years ago

Updates the C# code generation logic to build a table of all exported types so that the code generation logic can easily look up the full export information when dealing with type references. The main advantage of this currently is being able to access the binding style for a references type in order to correctly account for binding style in different contexts. This is specifically necessary when dealing with a reference to an enum type, as the generated C# type may be named differently depending on whether the type is marshaled by value or as a handle.