darwin: add abstraction for IOUSBInterfaceInterface

The IOUSBInterfaceInterface object is how libusb interfaces with the
interfaces of USB devices on macOS (Darwin, MacOS X, iOS, etc). For as
long as libusb has existed it has always used the highest available
version of the interface. This change breaks that by using the higest
version available for the current running version of macOS. This allows
the same libusb build to run on older and newer versions of macOS
without disabling newer features.

This change relies heavily on the fact that each new version of the
IOUSBInterfaceInterface object builds on prior versions. This means that
libusb can use the oldest version of the interface that has a specific
function without needing to use the specific version specified at open
time which greatly simplifies the code.

This commit update IOUSBInterfaceInterface only and leave the
IOUSBDeviceInterface as-is. A follow-on change will update the device
interface.

Signed-off-by: Nathan Hjelm <hjelmn@google.com>
3 files changed