diff --git a/src/device/macosdevicelister.mm b/src/device/macosdevicelister.mm index 0a4701c83..695852946 100644 --- a/src/device/macosdevicelister.mm +++ b/src/device/macosdevicelister.mm @@ -21,6 +21,7 @@ #include +#include #include #include #include @@ -155,7 +156,13 @@ bool MacOsDeviceLister::Init() { DASessionScheduleWithRunLoop(loop_session_, run_loop_, kCFRunLoopDefaultMode); // Register for USB device connection/disconnection. - IONotificationPortRef notification_port = IONotificationPortCreate(kIOMainPortDefault); + IONotificationPortRef notification_port = IONotificationPortCreate( +#if defined(MAC_OS_VERSION_12_0) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_VERSION_12_0) + kIOMainPortDefault +#else + kIOMasterPortDefault +#endif + ); CFMutableDictionaryRef matching_dict = IOServiceMatching(kIOUSBDeviceClassName); // IOServiceAddMatchingNotification decreases reference count. CFRetain(matching_dict); diff --git a/src/engine/macosdevicefinder.cpp b/src/engine/macosdevicefinder.cpp index 6d3cd5c94..f865b7e79 100644 --- a/src/engine/macosdevicefinder.cpp +++ b/src/engine/macosdevicefinder.cpp @@ -22,6 +22,7 @@ #include +#include #include #include @@ -69,7 +70,11 @@ EngineDeviceList MacOsDeviceFinder::ListDevices() { AudioObjectPropertyAddress address = { kAudioHardwarePropertyDevices, kAudioObjectPropertyScopeGlobal, +#if defined(MAC_OS_VERSION_12_0) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_VERSION_12_0) kAudioObjectPropertyElementMain +#else + kAudioObjectPropertyElementMaster +#endif }; UInt32 device_size_bytes = 0;