Path: blob/main_old/src/common/apple_platform_utils.h
1693 views
//1// Copyright 2019 The ANGLE Project Authors. All rights reserved.2// Use of this source code is governed by a BSD-style license that can be3// found in the LICENSE file.4//56// apple_platform_utils.h: Common utilities for Apple platforms.78#ifndef COMMON_APPLE_PLATFORM_UTILS_H_9#define COMMON_APPLE_PLATFORM_UTILS_H_1011#include <TargetConditionals.h>1213// These are macros for substitution of Apple specific directive @available:1415// TARGET_OS_MACCATALYST only available in MacSDK 10.151617#if TARGET_OS_MACCATALYST18// ANGLE_APPLE_AVAILABLE_XCI: check if either of the 3 platforms (OSX/Catalyst/iOS) min verions is19// available:20# define ANGLE_APPLE_AVAILABLE_XCI(macVer, macCatalystVer, iOSVer) \21@available(macOS macVer, macCatalyst macCatalystVer, iOS iOSVer, *)22// ANGLE_APPLE_AVAILABLE_XC: check if either of the 2 platforms (OSX/Catalyst) min verions is23// available:24# define ANGLE_APPLE_AVAILABLE_XC(macVer, macCatalystVer) \25@available(macOS macVer, macCatalyst macCatalystVer, *)26// ANGLE_APPLE_AVAILABLE_CI: check if either of the 2 platforms (Catalyst/iOS) min verions is27// available:28# define ANGLE_APPLE_AVAILABLE_CI(macCatalystVer, iOSVer) \29@available(macCatalyst macCatalystVer, iOS iOSVer, *)30#else31# define ANGLE_APPLE_AVAILABLE_XCI(macVer, macCatalystVer, iOSVer) \32ANGLE_APPLE_AVAILABLE_XI(macVer, iOSVer)3334# define ANGLE_APPLE_AVAILABLE_XC(macVer, macCatalystVer) @available(macOS macVer, *)35# define ANGLE_APPLE_AVAILABLE_CI(macCatalystVer, iOSVer) @available(iOS iOSVer, tvOS iOSVer, *)36#endif3738// ANGLE_APPLE_AVAILABLE_XI: check if either of the 2 platforms (OSX/iOS) min verions is available:39#define ANGLE_APPLE_AVAILABLE_XI(macVer, iOSVer) \40@available(macOS macVer, iOS iOSVer, tvOS iOSVer, *)4142// ANGLE_APPLE_AVAILABLE_I: check if a particular iOS version is available43#define ANGLE_APPLE_AVAILABLE_I(iOSVer) @available(iOS iOSVer, tvOS iOSVer, *)4445#endif464748