--- src/common/apple_platform_utils.h.orig +++ src/common/apple_platform_utils.h @@ -20,8 +20,10 @@ #endif #define ANGLE_APPLE_OBJC_SCOPE @autoreleasepool +#define ANGLE_APPLE_POOLSTART NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; +#define ANGLE_APPLE_POOLEND [pool release]; -#if !__has_feature(objc_arc) +#ifndef __clang__ # define ANGLE_APPLE_AUTORELEASE autorelease # define ANGLE_APPLE_RETAIN retain # define ANGLE_APPLE_RELEASE release @@ -33,7 +35,7 @@ #define ANGLE_APPLE_UNUSED __attribute__((unused)) -#if __has_warning("-Wdeprecated-declarations") +#ifdef __GNUC__ # define ANGLE_APPLE_ALLOW_DEPRECATED_BEGIN \ _Pragma("GCC diagnostic push") \ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") @@ -41,7 +43,7 @@ # define ANGLE_APPLE_ALLOW_DEPRECATED_BEGIN #endif -#if __has_warning("-Wdeprecated-declarations") +#ifdef __GNUC__ # define ANGLE_APPLE_ALLOW_DEPRECATED_END _Pragma("GCC diagnostic pop") #else # define ANGLE_APPLE_ALLOW_DEPRECATED_END --- src/common/apple_platform_utils.mm.orig +++ src/common/apple_platform_utils.mm @@ -11,13 +11,24 @@ #include "common/unsafe_buffers.h" #include -#include +#include + +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101100 +# include +#endif + +#if MAC_OS_X_VERSION_MIN_REQUIRED < 120000 +# define kIOMainPortDefault kIOMasterPortDefault +#endif namespace angle { bool IsMetalRendererAvailable() { +#if MAC_OS_X_VERSION_MIN_REQUIRED < 101100 + return false; +#else #if defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST) static bool queriedMachineModel = false; static bool machineModelSufficient = true; @@ -117,6 +128,7 @@ } }(); return gpuFamilySufficient; +#endif } #if defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)