linux-msm / qdl

BSD 3-Clause "New" or "Revised" License
225 stars 79 forks source link

usb: Allow building with older libusb #65

Closed quic-bjorande closed 5 months ago

quic-bjorande commented 5 months ago

libusb commit f0cce43f882d ("core: Fix definition and use of enum libusb_transfer_type") split the types of split transfer type and endpoint transfer, introducing LIBUSB_ENDPOINT_TRANSFER_TYPE_BULK.

The result is that when building with older libusb, such the one available on Ubuntu 20.04 the build fails with the following error:

usb.c:84:16: error: ‘LIBUSB_ENDPOINT_TRANSFER_TYPE_BULK’ undeclared (first use in this function); did you mean ‘LIBUSB_TRANSFER_TYPE_BULK’?

Introduce an alias using the preprocessor to make available the new define when building against the older version of libusb headers.