Fix build with macOS < 12.0
This commit is contained in:
parent
a333662f56
commit
45ad84a9bc
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include <libmtp.h>
|
#include <libmtp.h>
|
||||||
|
|
||||||
|
#include <AvailabilityMacros.h>
|
||||||
#include <CoreFoundation/CFRunLoop.h>
|
#include <CoreFoundation/CFRunLoop.h>
|
||||||
#include <DiskArbitration/DiskArbitration.h>
|
#include <DiskArbitration/DiskArbitration.h>
|
||||||
#include <IOKit/kext/KextManager.h>
|
#include <IOKit/kext/KextManager.h>
|
||||||
@ -155,7 +156,13 @@ bool MacOsDeviceLister::Init() {
|
|||||||
DASessionScheduleWithRunLoop(loop_session_, run_loop_, kCFRunLoopDefaultMode);
|
DASessionScheduleWithRunLoop(loop_session_, run_loop_, kCFRunLoopDefaultMode);
|
||||||
|
|
||||||
// Register for USB device connection/disconnection.
|
// 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);
|
CFMutableDictionaryRef matching_dict = IOServiceMatching(kIOUSBDeviceClassName);
|
||||||
// IOServiceAddMatchingNotification decreases reference count.
|
// IOServiceAddMatchingNotification decreases reference count.
|
||||||
CFRetain(matching_dict);
|
CFRetain(matching_dict);
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
#include <AvailabilityMacros.h>
|
||||||
#include <CoreAudio/AudioHardware.h>
|
#include <CoreAudio/AudioHardware.h>
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
@ -69,7 +70,11 @@ EngineDeviceList MacOsDeviceFinder::ListDevices() {
|
|||||||
AudioObjectPropertyAddress address = {
|
AudioObjectPropertyAddress address = {
|
||||||
kAudioHardwarePropertyDevices,
|
kAudioHardwarePropertyDevices,
|
||||||
kAudioObjectPropertyScopeGlobal,
|
kAudioObjectPropertyScopeGlobal,
|
||||||
|
#if defined(MAC_OS_VERSION_12_0) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_VERSION_12_0)
|
||||||
kAudioObjectPropertyElementMain
|
kAudioObjectPropertyElementMain
|
||||||
|
#else
|
||||||
|
kAudioObjectPropertyElementMaster
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
UInt32 device_size_bytes = 0;
|
UInt32 device_size_bytes = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user