File tree Expand file tree Collapse file tree 6 files changed +11
-11
lines changed
Expand file tree Collapse file tree 6 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -972,7 +972,7 @@ extension Driver {
972972 ///
973973 /// - Parameter content: response file's content to be tokenized.
974974 private static func tokenizeResponseFile( _ content: String ) -> [ String ] {
975- #if !os(macOS ) && !os(Linux) && !os(Android) && !os(OpenBSD)
975+ #if !canImport(Darwin ) && !os(Linux) && !os(Android) && !os(OpenBSD)
976976 #warning("Response file tokenization unimplemented for platform; behavior may be incorrect")
977977 #endif
978978 return content. split { $0 == " \n " || $0 == " \r \n " }
@@ -2621,7 +2621,7 @@ extension Triple {
26212621
26222622/// Toolchain computation.
26232623extension Driver {
2624- #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS )
2624+ #if canImport(Darwin )
26252625 static let defaultToolchainType : Toolchain . Type = DarwinToolchain . self
26262626 #elseif os(Windows)
26272627 static let defaultToolchainType : Toolchain . Type = WindowsToolchain . self
Original file line number Diff line number Diff line change @@ -442,8 +442,8 @@ extension ExplicitDependencyBuildPlanner {
442442 return previouslyHashsedName
443443 }
444444 let hashedArguments : String
445- #if os(macOS )
446- if #available( macOS 10 . 15 , iOS 13 , * ) {
445+ #if canImport(Darwin )
446+ if #available( macOS 10 . 15 , * ) {
447447 hashedArguments = CryptoKitSHA256 ( ) . hash ( hashInput) . hexadecimalRepresentation
448448 } else {
449449 hashedArguments = SHA256 ( ) . hash ( hashInput) . hexadecimalRepresentation
Original file line number Diff line number Diff line change @@ -112,8 +112,8 @@ import SwiftOptions
112112 . map { $0. option. spelling }
113113 . sorted ( )
114114 . joined ( )
115- #if os(macOS )
116- if #available( macOS 10 . 15 , iOS 13 , * ) {
115+ #if canImport(Darwin )
116+ if #available( macOS 10 . 15 , * ) {
117117 return CryptoKitSHA256 ( ) . hash ( hashInput) . hexadecimalRepresentation
118118 } else {
119119 return SHA256 ( ) . hash ( hashInput) . hexadecimalRepresentation
Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ public final class DarwinToolchain: Toolchain {
169169 diagnosticsEngine: DiagnosticsEngine ) throws {
170170 // On non-darwin hosts, libArcLite won't be found and a warning will be emitted
171171 // Guard for the sake of tests running on all platforms
172- #if os(macOS )
172+ #if canImport(Darwin )
173173 // Validating arclite library path when link-objc-runtime.
174174 validateLinkObjcRuntimeARCLiteLib ( & parsedOptions,
175175 targetTriple: targetTriple,
Original file line number Diff line number Diff line change 1010//
1111//===----------------------------------------------------------------------===//
1212
13- #if os(macOS )
13+ #if canImport(Darwin )
1414import Darwin
1515#elseif canImport(Glibc)
1616import Glibc
1717#endif
1818
19- #if os(macOS ) || os(Linux) || os(Android) || os(OpenBSD)
19+ #if canImport(Darwin ) || os(Linux) || os(Android) || os(OpenBSD)
2020// Adapted from llvm::sys::commandLineFitsWithinSystemLimits.
2121func commandLineFitsWithinSystemLimits( path: String , args: [ String ] ) -> Bool {
2222 let upperBound = sysconf ( Int32 ( _SC_ARG_MAX) )
Original file line number Diff line number Diff line change 1212import TSCBasic
1313import Foundation
1414
15- #if os(macOS )
15+ #if canImport(Darwin )
1616import Darwin
1717#endif
1818
@@ -736,7 +736,7 @@ extension TSCBasic.FileSystem {
736736 /// - Returns: A `Date` value containing the last modification time.
737737 public func lastModificationTime( for file: VirtualPath ) throws -> Date {
738738 try resolvingVirtualPath ( file) { path in
739- #if os(macOS )
739+ #if canImport(Darwin )
740740 var s = Darwin . stat ( )
741741 let err = stat ( path. pathString, & s)
742742 guard err == 0 else {
You can’t perform that action at this time.
0 commit comments