From 3f66dfbaf8601ac05d7ca5c8cfe7781c157e56b7 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Thu, 5 Jan 2023 10:58:04 +0000 Subject: [PATCH 1/2] MachPort: fix build issues with Swift 5.7 It seems that `#if $MoveOnly` check has no effect on Swift 5.7, so we should check whether Swift 5.8 or later are available first. Resolves #117. --- Sources/System/MachPort.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/System/MachPort.swift b/Sources/System/MachPort.swift index 8e7f8cf..39fdd66 100644 --- a/Sources/System/MachPort.swift +++ b/Sources/System/MachPort.swift @@ -7,7 +7,7 @@ See https://swift.org/LICENSE.txt for license information */ -#if $MoveOnly && (os(macOS) || os(iOS) || os(watchOS) || os(tvOS)) +#if swift(>=5.8) && $MoveOnly && (os(macOS) || os(iOS) || os(watchOS) || os(tvOS)) import Darwin.Mach From b5e330163a05601c6fc98b966b6cb282e46e8c26 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Thu, 5 Jan 2023 14:35:22 +0000 Subject: [PATCH 2/2] MachPortTests: fix build issues with Swift 5.7 --- Tests/SystemTests/MachPortTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/SystemTests/MachPortTests.swift b/Tests/SystemTests/MachPortTests.swift index 7faa976..5c119d1 100644 --- a/Tests/SystemTests/MachPortTests.swift +++ b/Tests/SystemTests/MachPortTests.swift @@ -7,7 +7,7 @@ See https://swift.org/LICENSE.txt for license information */ -#if $MoveOnly && (os(macOS) || os(iOS) || os(watchOS) || os(tvOS)) +#if swift(>=5.8) && $MoveOnly && (os(macOS) || os(iOS) || os(watchOS) || os(tvOS)) import XCTest import Darwin.Mach