From aba20254d8adbe62e7ab892594d86ed84f8ef2fc Mon Sep 17 00:00:00 2001 From: alufers Date: Mon, 27 Feb 2023 19:43:46 +0100 Subject: [PATCH] fix: Add missing fields to libusb_bos_descriptor and libusb_bos_dev_capability_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 --- libusb1-sys/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libusb1-sys/src/lib.rs b/libusb1-sys/src/lib.rs index 5cfb1db..a9ce629 100644 --- a/libusb1-sys/src/lib.rs +++ b/libusb1-sys/src/lib.rs @@ -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)] @@ -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)]