From fb70a0f5e984f23be48b11b4f1909f3bee016178 Mon Sep 17 00:00:00 2001 From: Franz Busch Date: Wed, 21 Jun 2023 14:12:47 +0100 Subject: [PATCH] Use #if canImport(Darwin) where possible (#201) --- Sources/NIOExtras/DebugInboundEventsHandler.swift | 2 +- Sources/NIOExtras/DebugOutboundEventsHandler.swift | 2 +- Sources/NIOExtras/WritePCAPHandler.swift | 2 +- Sources/NIOSOCKS/Messages/SOCKSRequest.swift | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/NIOExtras/DebugInboundEventsHandler.swift b/Sources/NIOExtras/DebugInboundEventsHandler.swift index de8bbcc5..9c6e4b70 100644 --- a/Sources/NIOExtras/DebugInboundEventsHandler.swift +++ b/Sources/NIOExtras/DebugInboundEventsHandler.swift @@ -11,7 +11,7 @@ // SPDX-License-Identifier: Apache-2.0 // //===----------------------------------------------------------------------===// -#if os(macOS) || os(tvOS) || os(iOS) || os(watchOS) +#if canImport(Darwin) import Darwin #else import Glibc diff --git a/Sources/NIOExtras/DebugOutboundEventsHandler.swift b/Sources/NIOExtras/DebugOutboundEventsHandler.swift index e76c723e..51e20959 100644 --- a/Sources/NIOExtras/DebugOutboundEventsHandler.swift +++ b/Sources/NIOExtras/DebugOutboundEventsHandler.swift @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -#if os(macOS) || os(tvOS) || os(iOS) || os(watchOS) +#if canImport(Darwin) import Darwin #else import Glibc diff --git a/Sources/NIOExtras/WritePCAPHandler.swift b/Sources/NIOExtras/WritePCAPHandler.swift index e93682b1..376c80f0 100644 --- a/Sources/NIOExtras/WritePCAPHandler.swift +++ b/Sources/NIOExtras/WritePCAPHandler.swift @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -#if os(macOS) || os(tvOS) || os(iOS) || os(watchOS) +#if canImport(Darwin) import Darwin #else import Glibc diff --git a/Sources/NIOSOCKS/Messages/SOCKSRequest.swift b/Sources/NIOSOCKS/Messages/SOCKSRequest.swift index e5edea8e..2a8d82e1 100644 --- a/Sources/NIOSOCKS/Messages/SOCKSRequest.swift +++ b/Sources/NIOSOCKS/Messages/SOCKSRequest.swift @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -#if os(macOS) || os(tvOS) || os(iOS) || os(watchOS) +#if canImport(Darwin) import Darwin #else import Glibc