Skip to content

Commit 6c99ed5

Browse files
authored
A few fixes for building SwiftPM for MacCatalyst (#6414)
1 parent 9d3a531 commit 6c99ed5

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

Sources/Basics/Cancellator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public final class Cancellator: Cancellable {
7373
// Terminate all processes on receiving an interrupt signal.
7474
try? self?.cancel(deadline: .now() + .seconds(30))
7575

76-
#if os(macOS) || os(OpenBSD)
76+
#if os(macOS) || targetEnvironment(macCatalyst) || os(OpenBSD)
7777
// Install the default signal handler.
7878
var action = sigaction()
7979
action.__sigaction_u.__sa_handler = SIG_DFL

Sources/swiftpm-xctest-helper/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ do {
138138

139139
#if os(Windows)
140140
import func ucrt.exit
141-
#else
141+
#elseif canImport(Glibc)
142142
import func Glibc.exit
143143
#endif
144144
print("Only macOS supported.")

Tests/PackageCollectionsSigningTests/Utilities.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,12 @@ struct TestCertificatePolicy: CertificatePolicy {
6262
#if os(macOS)
6363
self.verify(certChain: certChain, anchorCerts: self.anchorCerts, verifyDate: self.verifyDate,
6464
callbackQueue: callbackQueue, callback: callback)
65-
#else
65+
#elseif os(Linux) || os(Windows) || os(Android)
6666
self.verify(certChain: certChain, anchorCerts: self.anchorCerts, verifyDate: self.verifyDate, httpClient: nil,
6767
observabilityScope: ObservabilitySystem.NOOP,
6868
callbackQueue: callbackQueue, callback: callback)
69+
#else
70+
throw InternalError("not implemented")
6971
#endif
7072
} catch {
7173
return callbackQueue.async { callback(.failure(error)) }

0 commit comments

Comments
 (0)