Skip to content

Commit 47a7fd4

Browse files
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

File tree

ui/drivers/ui_cocoa.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
626626
[self.window setNextResponder:_listener];
627627
self.window.delegate = _listener;
628628
#else
629-
[[CocoaView get] setFrame: [[self.window contentView] bounds]];
629+
[(NSView*)[CocoaView get] setFrame: [[self.window contentView] bounds]];
630630
#endif
631631
[[self.window contentView] setAutoresizesSubviews:YES];
632632

0 commit comments

Comments
 (0)