mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-26 20:28:49 -05:00
Cocoa: Fix deprecation of kIOMasterPortDefault
This adds a workaround for kIOMasterPortDefault having been deprecated in favor of kIOMainPortDefault in macOS 12.0. Closes #1980
This commit is contained in:
parent
575d2971d4
commit
f75c251dec
|
@ -58,7 +58,7 @@ static char* getMonitorName(CGDirectDisplayID displayID, NSScreen* screen)
|
||||||
io_service_t service;
|
io_service_t service;
|
||||||
CFDictionaryRef info;
|
CFDictionaryRef info;
|
||||||
|
|
||||||
if (IOServiceGetMatchingServices(kIOMasterPortDefault,
|
if (IOServiceGetMatchingServices(kIOMainPortDefault,
|
||||||
IOServiceMatching("IODisplayConnect"),
|
IOServiceMatching("IODisplayConnect"),
|
||||||
&it) != 0)
|
&it) != 0)
|
||||||
{
|
{
|
||||||
|
@ -231,7 +231,7 @@ static double getFallbackRefreshRate(CGDirectDisplayID displayID)
|
||||||
io_iterator_t it;
|
io_iterator_t it;
|
||||||
io_service_t service;
|
io_service_t service;
|
||||||
|
|
||||||
if (IOServiceGetMatchingServices(kIOMasterPortDefault,
|
if (IOServiceGetMatchingServices(kIOMainPortDefault,
|
||||||
IOServiceMatching("IOFramebuffer"),
|
IOServiceMatching("IOFramebuffer"),
|
||||||
&it) != 0)
|
&it) != 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,6 +41,13 @@
|
||||||
typedef void* id;
|
typedef void* id;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// NOTE: Many Cocoa enum values have been renamed and we need to build across
|
||||||
|
// SDK versions where one is unavailable or the other deprecated
|
||||||
|
// We use the newer names in code and these macros to handle compatibility
|
||||||
|
#if MAC_OS_X_VERSION_MAX_ALLOWED < 120000
|
||||||
|
#define kIOMainPortDefault kIOMasterPortDefault
|
||||||
|
#endif
|
||||||
|
|
||||||
// NOTE: Many Cocoa enum values have been renamed and we need to build across
|
// NOTE: Many Cocoa enum values have been renamed and we need to build across
|
||||||
// SDK versions where one is unavailable or the other deprecated
|
// SDK versions where one is unavailable or the other deprecated
|
||||||
// We use the newer names in code and these macros to handle compatibility
|
// We use the newer names in code and these macros to handle compatibility
|
||||||
|
|
Loading…
Reference in New Issue
Block a user