darwin: Fix compilation on macOS 10.9 and earlier
authorEvan Miller <emmiller@gmail.com>
Sat, 6 Nov 2021 23:42:53 +0000 (19:42 -0400)
committerTormod Volden <debian.tormod@gmail.com>
Sun, 7 Nov 2021 10:38:03 +0000 (11:38 +0100)
kUSBReEnumerateCaptureDeviceMask was introduced in the 10.10 SDK, so
compiling on 10.9 and earlier will fail with:

 os/darwin_usb.c: In function 'darwin_reenumerate_device':
 os/darwin_usb.c:1749:18: error: 'kUSBReEnumerateCaptureDeviceMask' undeclared (first use in this function); did you mean 'USBReEnumerateOptions'?
        options |= kUSBReEnumerateCaptureDeviceMask;
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                   USBReEnumerateOptions
 os/darwin_usb.c:1749:18: note: each undeclared identifier is reported only once for each function it appears in

Downstream report: https://trac.macports.org/ticket/63668

Closes #1023

libusb/os/darwin_usb.c
libusb/version_nano.h

index 10af647..15457f7 100644 (file)
@@ -1758,7 +1758,9 @@ static int darwin_reenumerate_device (struct libusb_device_handle *dev_handle, b
   /* if we need to release capture */
   if (HAS_CAPTURE_DEVICE()) {
     if (capture) {
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101000
       options |= kUSBReEnumerateCaptureDeviceMask;
+#endif
     }
   } else {
     capture = false;
index 3c45733..1033492 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 11670
+#define LIBUSB_NANO 11671