Commit f8ef764
committed
gfx/dispserv_apple: use RARCH_RELEASE for iv so ARC builds also compile
Fixup for 93cdcb8 ('gfx/dispserv_apple: plug two MRC leaks in
macOS progress/resolution paths').
The previous patch added a raw '[iv release]' inside the
dispatch_once block. That compiled fine under the top-level qb
Makefile (this file is not in the per-file -fobjc-arc override
list at Makefile:275, so it builds MRC), but every Xcode project
in pkg/apple/ builds it under ARC - pkg/apple/BaseConfig.xcconfig:182
sets CLANG_ENABLE_OBJC_ARC=YES at the target level, and each
Xcode target compiles griffin/griffin_objc.m as a single umbrella
translation unit that #include's dispserv_apple.m (alongside
cocoa_input.m, coreaudio3.m, corelocation.m, and the rest of the
Apple-specific .m sources). Raw -release is an ARC compile error:
error: 'release' is unavailable: not available in automatic
reference counting mode
error: ARC forbids explicit message send of 'release'
Swap '[iv release]' for 'RARCH_RELEASE(iv)'. The macro in
libretro-common/include/defines/cocoa_defines.h expands to
'[(x) release]' under MRC (preserving the leak fix from 93cdcb8)
and to '((void)0)' under ARC, where the compiler inserts the
matching release at block-scope exit automatically. cocoa_defines.h
is already included at line 29 of this file, so no new header is
needed.
Also rewrote the adjacent comment to reflect reality - the file
compiles under BOTH build systems with different ARC modes, not
just MRC as the original comment claimed. This matches the
build matrix already documented in Makefile:269-276 and
Makefile.common:1649-1665.
Thread-safety / reachability: unchanged from 93cdcb8 - this is
a build-fix only. Runtime behaviour is identical under qb-MRC
(still does [iv release]) and correct by ARC semantics under
Xcode (ARC auto-releases on block scope exit).1 parent 3498771 commit f8ef764
1 file changed
Lines changed: 26 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
100 | 113 | | |
101 | 114 | | |
102 | 115 | | |
| |||
0 commit comments