depot/third_party/nixpkgs/pkgs/applications/video/mpv/0001-fix-darwin-build.patch

20 lines
523 B
Diff
Raw Normal View History

diff --git a/osdep/mac/input_helper.swift b/osdep/mac/input_helper.swift
index 0acec6bd40..0ec5837864 100644
--- a/osdep/mac/input_helper.swift
+++ b/osdep/mac/input_helper.swift
@@ -18,6 +18,14 @@
import Cocoa
import Carbon.HIToolbox
+extension NSCondition {
+ fileprivate func withLock<T>(_ body: () throws -> T) rethrows -> T {
+ self.lock()
+ defer { self.unlock() }
+ return try body()
+ }
+}
+
class InputHelper: NSObject {
var option: OptionHelper?
var lock = NSCondition()