Commit f4d1390
committed
cocoa_common: replace class/instance dot-syntax with bracket calls
GCC 4.0 (Xcode 3.1, PowerPC) reports:
cocoa_common.m:1059: error: syntax error before '.' token
cocoa_common.m:1074: error: syntax error before '.' token
Lines 1059 and 1074 use Objective-C class-method dot-syntax:
NSUserDefaults.standardUserDefaults
Class dot-syntax is a newer Obj-C 2.0 feature (Xcode 4.4+, 2012) that
GCC 4.0 doesn't support at all. The compiler tries to parse the
class name as an identifier, then stumbles on '.' because it isn't
a C struct.
Line 1062 has the companion issue: backup.UTF8String is instance
dot-syntax on -UTF8String, which on 10.5 is declared as a plain
method, not @Property. Apple GCC 4.0 supports instance dot-syntax
only for declared @Property — same class of issue as the earlier
cocoa-dot-syntax fixes in c49a525, d38dcb5.
Convert all three sites to bracket syntax:
[NSUserDefaults.standardUserDefaults foo]
-> [[NSUserDefaults standardUserDefaults] foo]
backup.UTF8String
-> [backup UTF8String]
Also preemptively fix an identical case at line 845 in
cocoa_screen_get_chosen (screens.count -> [screens count]) which
sits in OSX-reachable code and would fail next.
Modern clang compiles both forms identically. Zero runtime change.1 parent 26590dd commit f4d1390
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
842 | 842 | | |
843 | 843 | | |
844 | 844 | | |
845 | | - | |
| 845 | + | |
846 | 846 | | |
847 | 847 | | |
848 | 848 | | |
| |||
1056 | 1056 | | |
1057 | 1057 | | |
1058 | 1058 | | |
1059 | | - | |
| 1059 | + | |
1060 | 1060 | | |
1061 | 1061 | | |
1062 | | - | |
| 1062 | + | |
1063 | 1063 | | |
1064 | 1064 | | |
1065 | 1065 | | |
| |||
1071 | 1071 | | |
1072 | 1072 | | |
1073 | 1073 | | |
1074 | | - | |
| 1074 | + | |
1075 | 1075 | | |
1076 | 1076 | | |
1077 | 1077 | | |
| |||
0 commit comments