mac/option: explicitly include and define type of global init variable

the mpv_global struct is a public struct defined in common/global.h. in
the case that this header is included directly or indirectly into our
swift bridging header, code that uses that struct as an OpaquePointer
will fail to build, because swift would now be aware of its actual type.

preemptively include the header and properly define the type to prevent
such errors in the future.

i also checked all other usages of OpaquePointers and this is the only
case where this is relevant.

See e1d30c4 and 4ff9f50 as reference
This commit is contained in:
der richter committed 2024-12-01 19:25:37 +01:00
1 parent 0114281627
commit 11186374a0
2 files changed
+2 -1

No files matched your search

+1
View File
@@ -24,6 +24,7 @@
#include "options/m_config.h"
#include "player/core.h"
#include "common/global.h"
#include "input/input.h"
#include "input/event.h"
#include "input/keycodes.h"
+1 -1
View File
@@ -38,7 +38,7 @@ class OptionHelper {
var vo: mp_vo_opts { return voPtr.pointee }
var mac: macos_opts { return macPtr.pointee }
init(_ taParent: UnsafeMutableRawPointer, _ global: OpaquePointer?) {
init(_ taParent: UnsafeMutableRawPointer, _ global: UnsafeMutablePointer<mpv_global>?) {
voCachePtr = m_config_cache_alloc(taParent, global, AppHub.shared.getVoConf())
macCachePtr = m_config_cache_alloc(taParent, global, AppHub.shared.getMacConf())
}