summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--osdep/macOS_mpv_helper.swift4
-rw-r--r--osdep/macOS_swift_bridge.h5
2 files changed, 3 insertions, 6 deletions
diff --git a/osdep/macOS_mpv_helper.swift b/osdep/macOS_mpv_helper.swift
index c8b9771ba6..75f23251a9 100644
--- a/osdep/macOS_mpv_helper.swift
+++ b/osdep/macOS_mpv_helper.swift
@@ -19,6 +19,8 @@ import Cocoa
import OpenGL.GL
import OpenGL.GL3
+let glDummy: @convention(c) () -> Void = {}
+
class MPVHelper: NSObject {
var mpvHandle: OpaquePointer?
@@ -72,7 +74,7 @@ class MPVHelper: NSObject {
let addr = CFBundleGetFunctionPointerForName(indentifier, symbol)
if symbol as String == "glFlush" {
- return glDummyPtr()
+ return unsafeBitCast(glDummy, to: UnsafeMutableRawPointer.self)
}
return addr
diff --git a/osdep/macOS_swift_bridge.h b/osdep/macOS_swift_bridge.h
index d662dbcf4e..6886fce636 100644
--- a/osdep/macOS_swift_bridge.h
+++ b/osdep/macOS_swift_bridge.h
@@ -47,8 +47,3 @@ static int SWIFT_KEY_MOUSE_LEAVE = MP_KEY_MOUSE_LEAVE;
static int SWIFT_KEY_MOUSE_ENTER = MP_KEY_MOUSE_ENTER;
static int SWIFT_KEY_STATE_DOWN = MP_KEY_STATE_DOWN;
static int SWIFT_KEY_STATE_UP = MP_KEY_STATE_UP;
-
-// dummy function to override glFlush()
-static void glDummy() {}
-static void *glDummyPtr(void) __attribute__((unused));
-static void *glDummyPtr() { return &glDummy; }