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
Unified · Split
| @@ -24,6 +24,7 @@ · 23 unmodified lines | ||
| 24 | 24 | |
| 25 | 25 | #include "options/m_config.h" |
| 26 | 26 | #include "player/core.h" |
| 27 | +#include "common/global.h" | |
| 27 | 28 | #include "input/input.h" |
| 28 | 29 | #include "input/event.h" |
| 29 | 30 | #include "input/keycodes.h" |
| @@ -38,7 +38,7 @@ class OptionHelper { · 37 unmodified lines | ||
| 38 | 38 | var vo: mp_vo_opts { return voPtr.pointee } |
| 39 | 39 | var mac: macos_opts { return macPtr.pointee } |
| 40 | 40 | |
| 41 | − init(_ taParent: UnsafeMutableRawPointer, _ global: OpaquePointer?) { | |
| 41 | + init(_ taParent: UnsafeMutableRawPointer, _ global: UnsafeMutablePointer<mpv_global>?) { | |
| 42 | 42 | voCachePtr = m_config_cache_alloc(taParent, global, AppHub.shared.getVoConf()) |
| 43 | 43 | macCachePtr = m_config_cache_alloc(taParent, global, AppHub.shared.getMacConf()) |
| 44 | 44 | } |