summaryrefslogtreecommitdiffstats
path: root/osdep/macOS_mpv_helper.swift
diff options
context:
space:
mode:
authorAkemi <der.richter@gmx.de>2018-02-28 14:58:31 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-03-04 16:26:35 -0800
commitd7b6ebf64391327c60bdf50becd945f6237e5c9e (patch)
treeacacc7ffd0d089ee3f38580e3e5269e8d52f841d /osdep/macOS_mpv_helper.swift
parent42fd7d0bbf249ae9f78d49f89f79b8a159758018 (diff)
downloadmpv-d7b6ebf64391327c60bdf50becd945f6237e5c9e.tar.bz2
mpv-d7b6ebf64391327c60bdf50becd945f6237e5c9e.tar.xz
cocoa-cb: move the GL dummy function to swift
it's possible to get a function pointer through a closure after all in swift. remove the GL dummy function from the c header and do it in the swift code instead.
Diffstat (limited to 'osdep/macOS_mpv_helper.swift')
-rw-r--r--osdep/macOS_mpv_helper.swift4
1 files changed, 3 insertions, 1 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