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 #if TARGET_OS_MACCATALYST 19 // ANGLE_APPLE_AVAILABLE_XCI: check if either of the 3 platforms (OSX/Catalyst/iOS) min verions is 20 // available: 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 // ANGLE_APPLE_AVAILABLE_CI: check if either of the 2 platforms (Catalyst/iOS) min verions is 28 // available: 29 # define ANGLE_APPLE_AVAILABLE_CI(macCatalystVer, iOSVer) \ 30 @available(macCatalyst macCatalystVer, iOS iOSVer, *) 31 #else 32 # define ANGLE_APPLE_AVAILABLE_XCI(macVer, macCatalystVer, iOSVer) \ 33 ANGLE_APPLE_AVAILABLE_XI(macVer, iOSVer) 34 35 # define ANGLE_APPLE_AVAILABLE_XC(macVer, macCatalystVer) @available(macOS macVer, *) 36 # define ANGLE_APPLE_AVAILABLE_CI(macCatalystVer, iOSVer) @available(iOS iOSVer, tvOS iOSVer, *) 37 #endif 38 39 // ANGLE_APPLE_AVAILABLE_XI: check if either of the 2 platforms (OSX/iOS) min verions is available: 40 #define ANGLE_APPLE_AVAILABLE_XI(macVer, iOSVer) \ 41 @available(macOS macVer, iOS iOSVer, tvOS iOSVer, *) 42 43 // ANGLE_APPLE_AVAILABLE_I: check if a particular iOS version is available 44 #define ANGLE_APPLE_AVAILABLE_I(iOSVer) @available(iOS iOSVer, tvOS iOSVer, *) 45 46 #endif 47