woboq/qmetaobject-rs

Why do enums use repr(u32) instead of repr(c)?

Ayush1325 opened this issue · 2 comments

So recently I was trying to use some Qt enums and flags in rust. After looking through the code in qttypes, it seems the enums are using repr(u32) instead of repr(c) which I would have expected with FFI. So I was wondering about the reason for doing so. Is it a C++/Rust FFI thing or a QT thing?
Here is the Rust doc for C-style enums.

I don't remember why I did it like that.
I gues #[repr(C)] should also be Ok.

Ok. I also think we should change repr(u32) to repr(C) too.