From a4d818b4f9494b69fbd05b6ae2ff8c4bee0e9cec Mon Sep 17 00:00:00 2001 From: der richter Date: Sun, 7 Sep 2025 15:42:06 +0200 Subject: [PATCH] mac/compat: fix building with swift version lower than 5.7 currently we use the withLock function with NSCondition and NSLock, which are not available on swift versions lower than 5.7. we only added compatibility fallbacks for NSCondition though. introduced in 1364c80 and #14334. instead of only adding the fallback to a specific class add it to the whole protocol all the locking classes use, similar to the actual implementation. --- osdep/mac/swift_compat.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osdep/mac/swift_compat.swift b/osdep/mac/swift_compat.swift index 24365cdd4a..bac1abe082 100644 --- a/osdep/mac/swift_compat.swift +++ b/osdep/mac/swift_compat.swift @@ -16,7 +16,7 @@ */ #if !swift(>=5.7) -extension NSCondition { +extension NSLocking { func withLock(_ body: () throws -> R) rethrows -> R { self.lock() defer { self.unlock() }