Commit c49a525
committed
dispserv_apple: replace Obj-C 2.0 dot-syntax with bracket calls
Apple GCC 4.0 (the default compiler in Xcode 3.1) only supports
Objective-C 2.0 dot-syntax on explicitly declared @Property. On the
10.5-10.8 SDKs, NSWindow's isKeyWindow / alphaValue / styleMask are
declared as plain getter methods, not @Property — Apple only added
the @Property annotations in 10.10+. GCC 4.0 sees the dot-syntax,
notices NSWindow* isn't a struct, and bails:
dispserv_apple.m:62: error: request for member 'keyWindow' in
something not a structure or union
Convert every dot-syntax site in the OSX-only blocks to explicit
bracket method calls (e.g. window.keyWindow -> [window isKeyWindow],
window.alphaValue = x -> [window setAlphaValue:x]). Bracket syntax
works on every Apple compiler back to GCC 3.3, and modern clang
compiles it identically to the dot-syntax form.
Three functions touched:
- set_window_opacity: dot-syntax converted. No version gate
needed; the underlying APIs are all 10.0-era.
- set_window_progress: dot-syntax converted, AND gated on
RARCH_HAS_CGDISPLAYMODE_API (10.6+). This function relies on
dispatch_once and Obj-C blocks (^{}), neither of which exist
in GCC 4.0 / pre-10.6 toolchains. The driver struct slot
becomes NULL on pre-10.6, matching the existing iOS NULL.
- set_window_decorations: dot-syntax converted. Also pulled in
<defines/cocoa_defines.h> so that NSWindowStyleMaskTitled
(10.12+) gets its existing pre-10.12 polyfill (it expands to
the older NSTitledWindowMask).
Modern clang builds are unaffected — bracket syntax compiles to the
same code as dot-syntax there. Pre-10.6 builds lose the dock-tile
progress indicator but keep window opacity and decorations.1 parent 667256a commit c49a525
1 file changed
Lines changed: 23 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
61 | | - | |
62 | | - | |
| 63 | + | |
| 64 | + | |
63 | 65 | | |
64 | | - | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| 70 | + | |
| 71 | + | |
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
| |||
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
83 | 87 | | |
84 | 88 | | |
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
88 | | - | |
| 92 | + | |
89 | 93 | | |
90 | | - | |
91 | | - | |
| 94 | + | |
| 95 | + | |
92 | 96 | | |
93 | 97 | | |
94 | 98 | | |
| 99 | + | |
95 | 100 | | |
96 | 101 | | |
97 | 102 | | |
98 | 103 | | |
99 | 104 | | |
100 | | - | |
| 105 | + | |
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
104 | | - | |
| 109 | + | |
105 | 110 | | |
106 | | - | |
| 111 | + | |
107 | 112 | | |
108 | 113 | | |
109 | 114 | | |
| |||
578 | 583 | | |
579 | 584 | | |
580 | 585 | | |
| 586 | + | |
581 | 587 | | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
582 | 591 | | |
583 | 592 | | |
584 | 593 | | |
| |||
0 commit comments