Skip to content

Commit 5996c7a

Browse files
authored
Use #if canImport(Darwin) where possible (apple#269)
1 parent 1aacf8a commit 5996c7a

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

Sources/Logging/Logging.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
15+
#if canImport(Darwin)
1616
import Darwin
1717
#elseif os(Windows)
1818
import CRT
@@ -1242,7 +1242,7 @@ internal struct StdioOutputStream: TextOutputStream {
12421242
}
12431243

12441244
// Prevent name clashes
1245-
#if os(macOS) || os(tvOS) || os(iOS) || os(watchOS)
1245+
#if canImport(Darwin)
12461246
let systemStderr = Darwin.stderr
12471247
let systemStdout = Darwin.stdout
12481248
#elseif os(Windows)

Sources/Logging/MetadataProvider.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
15+
#if canImport(Darwin)
1616
import Darwin
1717
#elseif os(Windows)
1818
import CRT

Tests/LoggingTests/LoggingTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@testable import Logging
1515
import XCTest
1616

17-
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
17+
#if canImport(Darwin)
1818
import Darwin
1919
#elseif os(Windows)
2020
import WinSDK

Tests/LoggingTests/MetadataProviderTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@testable import Logging
1515
import XCTest
1616

17-
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
17+
#if canImport(Darwin)
1818
import Darwin
1919
#elseif os(Windows)
2020
import WinSDK

Tests/LoggingTests/TestLogger.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ public class MDC {
359359
}
360360

361361
private var threadId: Int {
362-
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
362+
#if canImport(Darwin)
363363
return Int(pthread_mach_thread_np(pthread_self()))
364364
#elseif os(Windows)
365365
return Int(GetCurrentThreadId())

0 commit comments

Comments
 (0)