Commit 461bfe4
committed
cocoa_gl_ctx: cast contentView to NSView* for -bounds on 32-bit
Fullscreen enter on the non-Metal path failed to compile on 32-bit
Darwin (10.5 PPC, 10.6 i386):
cocoa_gl_ctx.m:535: error: incompatible type for argument 1 of
'setFrame:'
-[NSWindow contentView] returns id on the 10.5-10.9 SDKs (only
tightened to NSView* in 10.10). When the receiver type is id, GCC
resolves selectors against every matching @interface it's seen.
-bounds is declared on two unrelated classes in our translation unit:
-[NSView bounds] returns NSRect
-[CALayer bounds] returns CGRect
On 64-bit macOS NSRect is a typedef for CGRect and the distinction
is invisible, but on 32-bit Darwin they're separate incompatible
structs (different CGFloat / NSPoint / NSSize underneath). GCC
resolves -bounds to CALayer's CGRect-returning method, and then
-setFrame:'s NSRect parameter won't accept the CGRect rvalue.
Cast the receiver to NSView* so -bounds resolves to NSView's NSRect
version. Same fix class as 8e428f4 (ui_cocoa.m:629,726) and
47a7fd4.
Not needed at the -addSubview: call sites (534, 554) because
-addSubview: is unique to NSView - no resolution ambiguity there.1 parent a1ddfb1 commit 461bfe4
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
532 | 532 | | |
533 | 533 | | |
534 | 534 | | |
535 | | - | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
536 | 543 | | |
537 | 544 | | |
538 | 545 | | |
| |||
0 commit comments