Fix build on XCode 13.1
Apple go on making it harder and harder to support multiple versions of their pathetic operating system in one code base. kIOMainPortDefault is the "non-deprecated" replacement for kIOMasterPortDefault. However, it is now marked as being available only on macOS 12 and later so it refuses to build in a codebase designed to run on earlier versions of macOS. Le bubbling sigh. According to https://developer.apple.com/documentation/iokit/kiomasterportdefault?language=objc passing NULL has the same effect and avoids the stupid warning. Hopefully this will work till Apple decides to spend their trillion dollars doing more stupid shit.
This commit is contained in:
parent
4dbf0c89c3
commit
e973c45968
@ -61,7 +61,7 @@ getDisplayName(CGDirectDisplayID displayID, NSScreen* screen)
|
||||
io_service_t service;
|
||||
CFDictionaryRef info;
|
||||
|
||||
if (IOServiceGetMatchingServices(kIOMainPortDefault,
|
||||
if (IOServiceGetMatchingServices(NULL,
|
||||
IOServiceMatching("IODisplayConnect"),
|
||||
&it) != 0)
|
||||
{
|
||||
@ -259,7 +259,7 @@ static double getFallbackRefreshRate(CGDirectDisplayID displayID)
|
||||
io_iterator_t it;
|
||||
io_service_t service;
|
||||
|
||||
if (IOServiceGetMatchingServices(kIOMainPortDefault,
|
||||
if (IOServiceGetMatchingServices(NULL,
|
||||
IOServiceMatching("IOFramebuffer"),
|
||||
&it) != 0)
|
||||
{
|
||||
|
||||
3
glfw/cocoa_platform.h
vendored
3
glfw/cocoa_platform.h
vendored
@ -39,9 +39,6 @@ typedef void* CVDisplayLinkRef;
|
||||
// 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) // Before macOS 12 Monterey
|
||||
#define kIOMainPortDefault kIOMasterPortDefault
|
||||
#endif
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 101200
|
||||
#define NSBitmapFormatAlphaNonpremultiplied NSAlphaNonpremultipliedBitmapFormat
|
||||
#define NSEventMaskAny NSAnyEventMask
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user