From 9f4e95edf71741cd8acad190d887a8306a2cc043 Mon Sep 17 00:00:00 2001 From: Francisco Javier Trujillo Mata Date: Tue, 30 Jul 2024 12:40:26 +0200 Subject: [PATCH] Update macro conditions for runtime usage --- Sources/JavaScriptEventLoop/JavaScriptEventLoop.swift | 2 +- Sources/JavaScriptEventLoop/WebWorkerTaskExecutor.swift | 2 +- Tests/JavaScriptEventLoopTests/WebWorkerTaskExecutorTests.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/JavaScriptEventLoop/JavaScriptEventLoop.swift b/Sources/JavaScriptEventLoop/JavaScriptEventLoop.swift index e1e023e7..765746bb 100644 --- a/Sources/JavaScriptEventLoop/JavaScriptEventLoop.swift +++ b/Sources/JavaScriptEventLoop/JavaScriptEventLoop.swift @@ -61,7 +61,7 @@ public final class JavaScriptEventLoop: SerialExecutor, @unchecked Sendable { return _shared } - #if compiler(>=6.0) && _runtime(_multithreaded) + #if compiler(>=6.1) && _runtime(_multithreaded) // In multi-threaded environment, we have an event loop executor per // thread (per Web Worker). A job enqueued in one thread should be // executed in the same thread under this global executor. diff --git a/Sources/JavaScriptEventLoop/WebWorkerTaskExecutor.swift b/Sources/JavaScriptEventLoop/WebWorkerTaskExecutor.swift index 5f382e2b..50aec741 100644 --- a/Sources/JavaScriptEventLoop/WebWorkerTaskExecutor.swift +++ b/Sources/JavaScriptEventLoop/WebWorkerTaskExecutor.swift @@ -1,4 +1,4 @@ -#if compiler(>=6.0) && _runtime(_multithreaded) // @_expose and @_extern are only available in Swift 6.0+ +#if compiler(>=6.1) && _runtime(_multithreaded) // @_expose and @_extern are only available in Swift 6.0+ import JavaScriptKit import _CJavaScriptKit diff --git a/Tests/JavaScriptEventLoopTests/WebWorkerTaskExecutorTests.swift b/Tests/JavaScriptEventLoopTests/WebWorkerTaskExecutorTests.swift index 94e7635e..a31c783d 100644 --- a/Tests/JavaScriptEventLoopTests/WebWorkerTaskExecutorTests.swift +++ b/Tests/JavaScriptEventLoopTests/WebWorkerTaskExecutorTests.swift @@ -1,4 +1,4 @@ -#if compiler(>=6.0) && _runtime(_multithreaded) +#if compiler(>=6.1) && _runtime(_multithreaded) import XCTest import JavaScriptKit import _CJavaScriptKit // For swjs_get_worker_thread_id