Commit 5b9c5dc
committed
cocoa_common: gate VoiceOver @available on 10.13 SDK
GCC 4.0 (Xcode 3.1, PowerPC) reports:
cocoa_common.m:77: error: stray '@' in program
@available(...) is a clang-only Obj-C extension (Xcode 7+, 2015).
GCC 4.0 sees the '@' followed by a non-keyword identifier and bails.
Same class of issue as the platform_darwin.m fixes in 2b51544,
6c80736, 27a843f, 2df15df.
RAIsVoiceOverRunning() is called from configuration.c and needs to
exist on every Cocoa build. NSWorkspace's isVoiceOverEnabled
property is 10.13+; on older SDKs it doesn't exist anyway, so the
only sensible behavior there is to return false.
Wrap the @available block in #if MAC_OS_X_VERSION_MAX_ALLOWED >=
101300. On 10.5-10.12 SDKs the block is preprocessed out entirely
and the function falls through to the existing 'return false'.
On 10.13+ SDKs (modern clang), behavior is unchanged.
The other 10 @available sites in this file are already preprocessed
out on macOS — they sit inside TARGET_OS_IOS, TARGET_OS_TV,
HAVE_COCOATOUCH, or SDK-version gates that only trigger on newer
build configurations.1 parent 2020a2e commit 5b9c5dc
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
77 | 82 | | |
78 | 83 | | |
| 84 | + | |
79 | 85 | | |
80 | 86 | | |
81 | 87 | | |
| |||
0 commit comments