File tree 6 files changed +11
-11
lines changed 6 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -972,7 +972,7 @@ extension Driver {
972
972
///
973
973
/// - Parameter content: response file's content to be tokenized.
974
974
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)
976
976
#warning("Response file tokenization unimplemented for platform; behavior may be incorrect")
977
977
#endif
978
978
return content. split { $0 == " \n " || $0 == " \r \n " }
@@ -2621,7 +2621,7 @@ extension Triple {
2621
2621
2622
2622
/// Toolchain computation.
2623
2623
extension Driver {
2624
- #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS )
2624
+ #if canImport(Darwin )
2625
2625
static let defaultToolchainType : Toolchain . Type = DarwinToolchain . self
2626
2626
#elseif os(Windows)
2627
2627
static let defaultToolchainType : Toolchain . Type = WindowsToolchain . self
Original file line number Diff line number Diff line change @@ -442,8 +442,8 @@ extension ExplicitDependencyBuildPlanner {
442
442
return previouslyHashsedName
443
443
}
444
444
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 , * ) {
447
447
hashedArguments = CryptoKitSHA256 ( ) . hash ( hashInput) . hexadecimalRepresentation
448
448
} else {
449
449
hashedArguments = SHA256 ( ) . hash ( hashInput) . hexadecimalRepresentation
Original file line number Diff line number Diff line change @@ -112,8 +112,8 @@ import SwiftOptions
112
112
. map { $0. option. spelling }
113
113
. sorted ( )
114
114
. joined ( )
115
- #if os(macOS )
116
- if #available( macOS 10 . 15 , iOS 13 , * ) {
115
+ #if canImport(Darwin )
116
+ if #available( macOS 10 . 15 , * ) {
117
117
return CryptoKitSHA256 ( ) . hash ( hashInput) . hexadecimalRepresentation
118
118
} else {
119
119
return SHA256 ( ) . hash ( hashInput) . hexadecimalRepresentation
Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ public final class DarwinToolchain: Toolchain {
169
169
diagnosticsEngine: DiagnosticsEngine ) throws {
170
170
// On non-darwin hosts, libArcLite won't be found and a warning will be emitted
171
171
// Guard for the sake of tests running on all platforms
172
- #if os(macOS )
172
+ #if canImport(Darwin )
173
173
// Validating arclite library path when link-objc-runtime.
174
174
validateLinkObjcRuntimeARCLiteLib ( & parsedOptions,
175
175
targetTriple: targetTriple,
Original file line number Diff line number Diff line change 10
10
//
11
11
//===----------------------------------------------------------------------===//
12
12
13
- #if os(macOS )
13
+ #if canImport(Darwin )
14
14
import Darwin
15
15
#elseif canImport(Glibc)
16
16
import Glibc
17
17
#endif
18
18
19
- #if os(macOS ) || os(Linux) || os(Android) || os(OpenBSD)
19
+ #if canImport(Darwin ) || os(Linux) || os(Android) || os(OpenBSD)
20
20
// Adapted from llvm::sys::commandLineFitsWithinSystemLimits.
21
21
func commandLineFitsWithinSystemLimits( path: String , args: [ String ] ) -> Bool {
22
22
let upperBound = sysconf ( Int32 ( _SC_ARG_MAX) )
Original file line number Diff line number Diff line change 12
12
import TSCBasic
13
13
import Foundation
14
14
15
- #if os(macOS )
15
+ #if canImport(Darwin )
16
16
import Darwin
17
17
#endif
18
18
@@ -736,7 +736,7 @@ extension TSCBasic.FileSystem {
736
736
/// - Returns: A `Date` value containing the last modification time.
737
737
public func lastModificationTime( for file: VirtualPath ) throws -> Date {
738
738
try resolvingVirtualPath ( file) { path in
739
- #if os(macOS )
739
+ #if canImport(Darwin )
740
740
var s = Darwin . stat ( )
741
741
let err = stat ( path. pathString, & s)
742
742
guard err == 0 else {
You can’t perform that action at this time.
0 commit comments