mozilla / cbindgen

A project for generating C bindings from Rust code
Mozilla Public License 2.0
2.43k stars 315 forks source link

Add support for transparent enums #992

Open scovich opened 3 months ago

scovich commented 3 months ago

The code restructuring work that allows transparent typedefs (see https://github.com/mozilla/cbindgen/pull/966) makes it straightforward to also support rust's transparent enums if we want to do so. Add the support, including accompanying tests and documentation.

NOTE: This PR is currently stacked on top of https://github.com/mozilla/cbindgen/pull/966, so the first two commits should be ignored while reviewing.