Files
swift-mirror/include/swift/AST/PlatformKinds.def
Artem Chikin 1f14158a1d Introduce VisionOS Platform
This change introduces a new compilation target platform to the Swift compiler - visionOS.

- Changes to the compiler build infrastrucuture to support building compiler-adjacent artifacts and test suites for the new target.
- Addition of the new platform kind definition.
- Support for the new platform in language constructs such as compile-time availability annotations or runtime OS version queries.
- Utilities to read out Darwin platform SDK info containing platform mapping data.
- Utilities to support re-mapping availability annotations from iOS to visionOS (e.g. 'updateIntroducedPlatformForFallback', 'updateDeprecatedPlatformForFallback', 'updateObsoletedPlatformForFallback').
- Additional tests exercising platform-specific availability handling and availability re-mapping fallback code-path.
- Changes to existing test suite to accomodate the new platform.
2024-04-10 09:38:02 -07:00

41 lines
1.8 KiB
C++

//===--- PlatformKinds.def - Swift PlatformKind Metaprogramming -*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// This file defines macros used for macro-metaprogramming with platform kinds.
//
//===----------------------------------------------------------------------===//
/// AVAILABILITY_PLATFORM(X, PrettyName)
/// X - The name of the platform
/// PrettyName - A string with the platform name for pretty printing
#ifndef AVAILABILITY_PLATFORM
#define AVAILABILITY_PLATFORM(X, PrettyName)
#endif
// Reordering these platforms will break serialization.
AVAILABILITY_PLATFORM(iOS, "iOS")
AVAILABILITY_PLATFORM(tvOS, "tvOS")
AVAILABILITY_PLATFORM(watchOS, "watchOS")
AVAILABILITY_PLATFORM(visionOS, "visionOS")
AVAILABILITY_PLATFORM(macOS, "macOS")
AVAILABILITY_PLATFORM(iOSApplicationExtension, "application extensions for iOS")
AVAILABILITY_PLATFORM(tvOSApplicationExtension, "application extensions for tvOS")
AVAILABILITY_PLATFORM(watchOSApplicationExtension, "application extensions for watchOS")
AVAILABILITY_PLATFORM(visionOSApplicationExtension, "application extensions for visionOS")
AVAILABILITY_PLATFORM(macOSApplicationExtension, "application extensions for macOS")
AVAILABILITY_PLATFORM(macCatalyst, "Mac Catalyst")
AVAILABILITY_PLATFORM(macCatalystApplicationExtension, "application extensions for Mac Catalyst")
AVAILABILITY_PLATFORM(OpenBSD, "OpenBSD")
AVAILABILITY_PLATFORM(Windows, "Windows")
#undef AVAILABILITY_PLATFORM