Convert C/C++ typedef or struct or types into Rust-native

Emptying out text, as I'd like to wipe these, please.

Do you just want a Rust type that could serve the same purpose, or do you actually need to use it in FFI? Rust enums are not FFI compatible with C tagged unions.

Actually, they can have #[repr(...)] and they'll do. Type layout - The Rust Reference (rust-lang.org).

This looks like a text processing problem.
Maybe an awk script would be easier than doing it by hand?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.