1 // 2 // Copyright 2019 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 7 // apple_platform_utils.h: Common utilities for Apple platforms. 8 9 #ifndef COMMON_APPLE_PLATFORM_UTILS_H_ 10 #define COMMON_APPLE_PLATFORM_UTILS_H_ 11 12 #include <TargetConditionals.h> 13 14 // These are macros for substitution of Apple specific directive @available: 15 16 // TARGET_OS_MACCATALYST only available in MacSDK 10.15 17 18 // ANGLE_APPLE_AVAILABLE_XCI: check if either of the 3 platforms (OSX/Catalyst/iOS) min verions is 19 // available: 20 #if TARGET_OS_MACCATALYST 21 # define ANGLE_APPLE_AVAILABLE_XCI(macVer, macCatalystVer, iOSVer) \ 22 @available(macOS macVer, macCatalyst macCatalystVer, iOS iOSVer, *) 23 // ANGLE_APPLE_AVAILABLE_XC: check if either of the 2 platforms (OSX/Catalyst) min verions is 24 // available: 25 # define ANGLE_APPLE_AVAILABLE_XC(macVer, macCatalystVer) \ 26 @available(macOS macVer, macCatalyst macCatalystVer, *) 27 #else 28 # define ANGLE_APPLE_AVAILABLE_XCI(macVer, macCatalystVer, iOSVer) \ 29 ANGLE_APPLE_AVAILABLE_XI(macVer, iOSVer) 30 // ANGLE_APPLE_AVAILABLE_XC: check if either of the 2 platforms (OSX/Catalyst) min verions is 31 // available: 32 # define ANGLE_APPLE_AVAILABLE_XC(macVer, macCatalystVer) @available(macOS macVer, *) 33 #endif 34 35 // ANGLE_APPLE_AVAILABLE_XI: check if either of the 2 platforms (OSX/iOS) min verions is available: 36 #define ANGLE_APPLE_AVAILABLE_XI(macVer, iOSVer) @available(macOS macVer, iOS iOSVer, *) 37 38 #endif 39