Skip to content

Commit 3e4f133

Browse files
committed
Fix the build on FreeBSD
Switch to more future-proof #if conditionals.
1 parent d169154 commit 3e4f133

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Plugins/Swift-DocC Preview/SwiftDocCPreview.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ import PackagePlugin
128128

129129

130130
func stopPreviewProcess() {
131-
#if os(macOS) && os(iOS) && os(tvOS) && os(watchOS)
131+
#if canImport(Darwin)
132132
previewProcess.interrupt()
133133
#elseif os(Windows)
134134
_ = TerminateProcess(previewProcess.processHandle, 0)

Sources/SwiftDocCPluginUtilities/DispatchTimeInterval+descriptionInSeconds.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extension DispatchTimeInterval {
2828
return String(format: "%.2f", Double(value)/Double(1_000_000_000)) + "s"
2929
case .never:
3030
return "n/a"
31-
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
31+
#if canImport(Darwin)
3232
@unknown default:
3333
return "n/a"
3434
#endif
@@ -38,7 +38,7 @@ extension DispatchTimeInterval {
3838

3939
// `distance(to:)` is currently only available on macOS. This should be removed
4040
// when it's available on all platforms.
41-
#if os(Linux) || os(Windows) || os(Android) || os(OpenBSD)
41+
#if !canImport(Darwin)
4242
extension DispatchTime {
4343
public func distance(to: DispatchTime) -> DispatchTimeInterval {
4444
let duration = to.uptimeNanoseconds - self.uptimeNanoseconds

0 commit comments

Comments
 (0)