From 699ada1724459582303c15aae64fa12ca4d33809 Mon Sep 17 00:00:00 2001 From: Donald Ness Date: Mon, 4 Oct 2021 19:20:07 -0500 Subject: [PATCH] Add guards for code that relies on _Concurrency (#237) This allows Xcode 13 to still compile on macOS 11 which does not have symbols for Concurrency yet See swift-server/swift-service-lifecycle#110 --- Sources/AWSLambdaRuntimeCore/LambdaHandler.swift | 2 +- Tests/AWSLambdaRuntimeCoreTests/LambdaHandlerTest.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/AWSLambdaRuntimeCore/LambdaHandler.swift b/Sources/AWSLambdaRuntimeCore/LambdaHandler.swift index bf02860e..2c29f2a1 100644 --- a/Sources/AWSLambdaRuntimeCore/LambdaHandler.swift +++ b/Sources/AWSLambdaRuntimeCore/LambdaHandler.swift @@ -88,7 +88,7 @@ extension LambdaHandler { // MARK: - AsyncLambdaHandler -#if compiler(>=5.5) +#if compiler(>=5.5) && canImport(_Concurrency) /// Strongly typed, processing protocol for a Lambda that takes a user defined `In` and returns a user defined `Out` async. @available(macOS 12, iOS 15, tvOS 15, watchOS 8, *) public protocol AsyncLambdaHandler: EventLoopLambdaHandler { diff --git a/Tests/AWSLambdaRuntimeCoreTests/LambdaHandlerTest.swift b/Tests/AWSLambdaRuntimeCoreTests/LambdaHandlerTest.swift index 3406d52f..ce4c21f4 100644 --- a/Tests/AWSLambdaRuntimeCoreTests/LambdaHandlerTest.swift +++ b/Tests/AWSLambdaRuntimeCoreTests/LambdaHandlerTest.swift @@ -79,7 +79,7 @@ class LambdaHandlerTest: XCTestCase { assertLambdaLifecycleResult(result, shoudHaveRun: maxTimes) } - #if compiler(>=5.5) + #if compiler(>=5.5) && canImport(_Concurrency) // MARK: - AsyncLambdaHandler