History

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

der richter committed 1 year ago

Commit 11186371 parent 01142812 files · +2 −1Browse files

Unified · Split

2 files
  1. osdep/mac/app_bridge_objc.h +1 −0
  2. osdep/mac/option_helper.swift +1 −1
osdep/mac/app_bridge_objc.h+1−0
@@ -24,6 +24,7 @@ · 23 unmodified lines
24 24
25#include "options/m_config.h"25#include "options/m_config.h"
26#include "player/core.h"26#include "player/core.h"
27#include "common/global.h"
27#include "input/input.h"28#include "input/input.h"
28#include "input/event.h"29#include "input/event.h"
29#include "input/keycodes.h"30#include "input/keycodes.h"
osdep/mac/option_helper.swift+1−1
@@ -38,7 +38,7 @@ class OptionHelper { · 37 unmodified lines
38 var vo: mp_vo_opts { return voPtr.pointee }38 var vo: mp_vo_opts { return voPtr.pointee }
39 var mac: macos_opts { return macPtr.pointee }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 voCachePtr = m_config_cache_alloc(taParent, global, AppHub.shared.getVoConf())42 voCachePtr = m_config_cache_alloc(taParent, global, AppHub.shared.getVoConf())
43 macCachePtr = m_config_cache_alloc(taParent, global, AppHub.shared.getMacConf())43 macCachePtr = m_config_cache_alloc(taParent, global, AppHub.shared.getMacConf())
44 }44 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t