Skip to content

Commit

Permalink
fix: Add missing fields to libusb_bos_descriptor and libusb_bos_dev_c…
Browse files Browse the repository at this point in the history
…apability_descriptor

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
  • Loading branch information
alufers committed Feb 27, 2023
1 parent df483fa commit aba2025
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libusb1-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ pub struct libusb_bos_dev_capability_descriptor {
pub bLength: u8,
pub bDescriptorType: u8,
pub bDevCapabilityType: u8,
pub dev_capability_data: [u8; 0],
}

#[allow(non_snake_case)]
Expand All @@ -135,6 +136,7 @@ pub struct libusb_bos_descriptor {
pub bDescriptorType: u8,
pub wTotalLength: u16,
pub bNumDeviceCaps: u8,
pub dev_capability: [libusb_bos_dev_capability_descriptor; 0],
}

#[allow(non_snake_case)]
Expand Down

0 comments on commit aba2025

Please sign in to comment.