rename deprecated constant kIOMasterPortDefault
This constant is now deprecated since macOS 12.0 and a new constant named kIOMainPortDefault is provided. There is a fallback in place that retains compatibility for older macOS versions. https://developer.apple.com/documentation/iokit/kiomasterportdefault [ gsi: tweak style to match existing code base ]
This commit is contained in:
parent
6f9b03e597
commit
323881f8a4
@ -93,6 +93,9 @@
|
||||
#include <IOKit/serial/ioss.h>
|
||||
#include <sys/syslimits.h>
|
||||
#include <mach/mach_time.h>
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 120000 /* Before macOS 12 */
|
||||
#define kIOMainPortDefault kIOMasterPortDefault
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __linux__
|
||||
#include <dirent.h>
|
||||
|
4
macosx.c
4
macosx.c
@ -42,7 +42,7 @@ SP_PRIV enum sp_return get_port_details(struct sp_port *port)
|
||||
if (!(classes = IOServiceMatching(kIOSerialBSDServiceValue)))
|
||||
RETURN_FAIL("IOServiceMatching() failed");
|
||||
|
||||
if (IOServiceGetMatchingServices(kIOMasterPortDefault, classes,
|
||||
if (IOServiceGetMatchingServices(kIOMainPortDefault, classes,
|
||||
&iter) != KERN_SUCCESS)
|
||||
RETURN_FAIL("IOServiceGetMatchingServices() failed");
|
||||
|
||||
@ -210,7 +210,7 @@ SP_PRIV enum sp_return list_ports(struct sp_port ***list)
|
||||
}
|
||||
|
||||
DEBUG("Getting matching services");
|
||||
if (IOServiceGetMatchingServices(kIOMasterPortDefault, classes,
|
||||
if (IOServiceGetMatchingServices(kIOMainPortDefault, classes,
|
||||
&iter) != KERN_SUCCESS) {
|
||||
SET_FAIL(ret, "IOServiceGetMatchingServices() failed");
|
||||
goto out_done;
|
||||
|
Loading…
Reference in New Issue
Block a user