Open YohDeadfall opened 1 month ago
This is fairly common. All the #define constants are considered to be u32s.
Generally an “as” cast is good enough.
I think providing some kind of hint list would be a lot of upkeep
Yeah, there's no way to fix this generally because the C code doesn't really care what the type is: it is going to impose numeric coercions on inputs until it gets what it wants. So it will be coerced in different ways in different places. So you have to do the same by hand in Rust, sometimes.
for note, we could tell bindgen to shrink the constants to their smallest applicable type, but that would probably be really fucking annoying rather than helpful.
Today I found an issue while working with transactions and non-atomic connections:
Not sure that it's possible to be done automatically from the code only, but having a list of hints can fix it.