Closed alufers closed 5 months ago
Hello, any progress on this?
This looks like breaking changes.
No, the fields are simply missing in the Rust version, causing memory corruption when they are not present.
The statement about memory corruption is not true. In this example https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=cfe918958abb877dbf05dc9a3d737c33 You can see that size and layout for structure is the same. The only downside of missing this filed is less ergonomic usage.
Yes, this filed missing in current rust version. But I can't accept this PR right now because this breaking change for users. I will merge this when I make a new release(0.7.0). Probably when 1.27 libusb released.
Okay, sorry for the false statement. Was remembering this from memory, probably confused something. No rush, I have worked around this, as you say - less ergonomically.
Thank you. Merged.
This fix adds missing fields to these two structs so that they can be used from rust without the size mismatching from the C version.
See:
https://libusb.sourceforge.io/api-1.0/structlibusb__bos__descriptor.html https://libusb.sourceforge.io/api-1.0/structlibusb__bos__dev__capability__descriptor.html