Skip to content

Commit

Permalink
usb1._libusb1: Mark libusb_control_setup as packed
Browse files Browse the repository at this point in the history
Following a libusb commit: which states that libusb relies on this struct
not having any padding but until now it was left to the compiler to decide.
Apparently no compiler (nor ctypes) insert padding as otherwise it would
have broken all asynchronous control transfers, but better be explicit.
  • Loading branch information
vpelletier committed Mar 5, 2024
1 parent f7927af commit a03f4c3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions usb1/_libusb1.py
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,7 @@ class libusb_config_descriptor(Structure):
libusb_config_descriptor_p_p = POINTER(libusb_config_descriptor_p)

class libusb_control_setup(Structure):
_pack_ = 1
_fields_ = [
('bmRequestType', c_uint8),
('bRequest', c_uint8),
Expand Down

0 comments on commit a03f4c3

Please sign in to comment.