Commit 47a7fd4
committed
ui_cocoa: cast [CocoaView get] to (NSView*) before setFrame:
GCC 4.0 (Xcode 3.1, PowerPC) reports:
ui_cocoa.m:629: error: incompatible type for argument 1
of 'setFrame:'
cocoa_common.h pulls in <QuartzCore/QuartzCore.h>, which declares
CALayer's -(void)setFrame:(CGRect). NSView also declares -(void)
setFrame:(NSRect). On 32-bit 10.5, NSRect and CGRect are separate,
incompatible types — Apple only unified them on LP64 (NS_BUILD_32_
LIKE_64 changes the 32-bit behavior).
GCC 4.0's Objective-C method picker, when faced with two visible
setFrame: selectors, doesn't always disambiguate based on the
receiver's static type. It picked CALayer's CGRect variant and
rejected the NSRect that [[self.window contentView] bounds]
returned. Modern clang resolves this correctly.
Add an explicit (NSView*) cast on the receiver so the compiler
unambiguously picks the NSView variant. Zero runtime change.
The neighboring _renderView call at line 726 doesn't need the same
treatment because _renderView is already declared as NSView*.1 parent c49a525 commit 47a7fd4
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
626 | 626 | | |
627 | 627 | | |
628 | 628 | | |
629 | | - | |
| 629 | + | |
630 | 630 | | |
631 | 631 | | |
632 | 632 | | |
| |||
0 commit comments