Open DBLouis opened 3 years ago
Indeed, that ought to be the implementation 👌 I am waiting on this since I'd like to bundle support for repr_c::Result
from there, and I want to think a bit about the best design / layout (e.g., C ergonomics) for such a thing 🙂
I had a go at it but I'm stuck making the macro match all kinds of enums variants.
Yeah, I think this will require https://github.com/getditto/safer_ffi/issues/46, the current situation with macro_rules!
macros to save a bit of compile time is not worth the maintainability cost
Is it possible to add support for
#[repr(C, Int)]
enums?In the Type layout reference it says:
I am not sure is this is guaranteed tho. If it is we should be able to transmute both ways right?
Playground test: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=fe82b419608d325d93481155c4458bc8