The kIOMasterPortDefault constant has been replaced by kIOMainPortDefault. Both
are synonmys for 0. To avoid extra checks on the target macOS release just go
ahead and use 0.
Signed-off-by: Nathan Hjelm <hjelmn@google.com>
static int init_count = 0;
static int init_count = 0;
+/* Both kIOMasterPortDefault or kIOMainPortDefault are synonyms for 0. */
+static const mach_port_t darwin_default_master_port = 0;
+
/* async event thread */
static pthread_mutex_t libusb_darwin_at_mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t libusb_darwin_at_cond = PTHREAD_COND_INITIALIZER;
/* async event thread */
static pthread_mutex_t libusb_darwin_at_mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t libusb_darwin_at_cond = PTHREAD_COND_INITIALIZER;
CFRelease (locationCF);
}
CFRelease (locationCF);
}
- return IOServiceGetMatchingServices(kIOMasterPortDefault, matchingDict, deviceIterator);
+ return IOServiceGetMatchingServices(darwin_default_master_port, matchingDict, deviceIterator);
}
/* Returns 1 on success, 0 on failure. */
}
/* Returns 1 on success, 0 on failure. */
/* since a kernel thread may notify the IOIterators used for
* hotplug notification we can't just clear the iterators.
* instead just wait until all IOService providers are quiet */
/* since a kernel thread may notify the IOIterators used for
* hotplug notification we can't just clear the iterators.
* instead just wait until all IOService providers are quiet */
- (void) IOKitWaitQuiet (kIOMasterPortDefault, &timeout);
+ (void) IOKitWaitQuiet (darwin_default_master_port, &timeout);
}
static void darwin_clear_iterator (io_iterator_t iter) {
}
static void darwin_clear_iterator (io_iterator_t iter) {
CFRunLoopAddSource(runloop, libusb_shutdown_cfsource, kCFRunLoopDefaultMode);
/* add the notification port to the run loop */
CFRunLoopAddSource(runloop, libusb_shutdown_cfsource, kCFRunLoopDefaultMode);
/* add the notification port to the run loop */
- libusb_notification_port = IONotificationPortCreate (kIOMasterPortDefault);
+ libusb_notification_port = IONotificationPortCreate (darwin_default_master_port);
libusb_notification_cfsource = IONotificationPortGetRunLoopSource (libusb_notification_port);
CFRunLoopAddSource(runloop, libusb_notification_cfsource, kCFRunLoopDefaultMode);
libusb_notification_cfsource = IONotificationPortGetRunLoopSource (libusb_notification_port);
CFRunLoopAddSource(runloop, libusb_notification_cfsource, kCFRunLoopDefaultMode);
CFRelease (locationCF);
CFRelease (propertyMatchDict);
CFRelease (locationCF);
CFRelease (propertyMatchDict);
- return IOServiceGetMatchingService (kIOMasterPortDefault, matchingDict);
+ return IOServiceGetMatchingService (darwin_default_master_port, matchingDict);
}
static int darwin_kernel_driver_active(struct libusb_device_handle *dev_handle, uint8_t interface) {
}
static int darwin_kernel_driver_active(struct libusb_device_handle *dev_handle, uint8_t interface) {
-#define LIBUSB_NANO 11657
+#define LIBUSB_NANO 11658