On Fri, Nov 06, 2015 at 02:47:10AM -0600, Ken Thomases wrote:
dlls/winemac.drv/Makefile.in | 2 +- dlls/winemac.drv/cocoa_window.h | 2 + dlls/winemac.drv/cocoa_window.m | 166 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 169 insertions(+), 1 deletion(-)
Hi Ken,
This doesn't build for me on 10.7:
gcc -m32 -c -o cocoa_window.o cocoa_window.m -I. -I../../include -D__WINESRC__ -D_REENTRANT -fPIC -Wall -pipe \ -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wstrict-prototypes \ -Wwrite-strings -Wpointer-arith -gdwarf-2 -fno-omit-frame-pointer -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 cocoa_window.m:161: error: expected specifier-qualifier-list before ‘CVDisplayLinkRef’ cocoa_window.m:174: error: expected ‘)’ before ‘displayLink’ cocoa_window.m: In function ‘-[WineDisplayLink initWithDisplayID:]’: cocoa_window.m:181: warning: implicit declaration of function ‘CVDisplayLinkCreateWithCGDisplay’ cocoa_window.m:181: error: ‘_link’ undeclared (first use in this function) cocoa_window.m:181: error: (Each undeclared identifier is reported only once cocoa_window.m:181: error: for each function it appears in.) cocoa_window.m:185: warning: implicit declaration of function ‘CVDisplayLinkSetOutputCallback’ cocoa_window.m:185: error: ‘WineDisplayLinkCallback’ undeclared (first use in this function) cocoa_window.m: In function ‘-[WineDisplayLink dealloc]’: cocoa_window.m:200: error: ‘_link’ undeclared (first use in this function) cocoa_window.m:202: warning: implicit declaration of function ‘CVDisplayLinkStop’ cocoa_window.m:203: warning: implicit declaration of function ‘CVDisplayLinkRelease’ cocoa_window.m: In function ‘-[WineDisplayLink addWindow:]’: cocoa_window.m:215: warning: implicit declaration of function ‘CVDisplayLinkStart’ cocoa_window.m:215: error: ‘_link’ undeclared (first use in this function) cocoa_window.m: In function ‘-[WineDisplayLink removeWindow:]’: cocoa_window.m:225: error: ‘_link’ undeclared (first use in this function) cocoa_window.m: At top level: cocoa_window.m:242: error: expected ‘)’ before ‘displayLink’ cocoa_window.m: In function ‘+[WineWindow createWindowWithFeatures:windowFrame:hwnd:queue:]’: cocoa_window.m:689: error: request for member ‘autodisplay’ in something not a structure or union cocoa_window.m: In function ‘-[WineWindow orderBelow:orAbove:activate:]’: cocoa_window.m:1310: warning: ‘WineWindow’ may not respond to ‘-checkWineDisplayLink’ cocoa_window.m:1310: warning: (Messages without a matching method signature cocoa_window.m:1310: warning: will be assumed to return ‘id’ and accept cocoa_window.m:1310: warning: ‘...’ as arguments.) cocoa_window.m:1329: warning: ‘WineWindow’ may not respond to ‘-checkWineDisplayLink’ cocoa_window.m: In function ‘-[WineWindow doOrderOut]’: cocoa_window.m:1370: warning: ISO C90 forbids mixed declarations and code cocoa_window.m:1372: warning: ‘WineWindow’ may not respond to ‘-grabDockIconSnapshotFromWindow:force:’ cocoa_window.m:1383: warning: ‘WineWindow’ may not respond to ‘-checkWineDisplayLink’ cocoa_window.m: In function ‘-[WineWindow checkWineDisplayLink]’: cocoa_window.m:1682: warning: ‘WineWindow’ may not respond to ‘-isEmptyShaped’ cocoa_window.m:1689: warning: ISO C90 forbids mixed declarations and code cocoa_window.m:1694: warning: ISO C90 forbids mixed declarations and code cocoa_window.m: In function ‘-[WineWindow grabDockIconSnapshotFromWindow:force:]’: cocoa_window.m:1744: warning: ISO C90 forbids mixed declarations and code cocoa_window.m:1761: warning: ISO C90 forbids mixed declarations and code cocoa_window.m:1774: warning: ISO C90 forbids mixed declarations and code cocoa_window.m:1781: warning: ISO C90 forbids mixed declarations and code cocoa_window.m:1785: warning: ISO C90 forbids mixed declarations and code cocoa_window.m:1788: warning: ISO C90 forbids mixed declarations and code cocoa_window.m:1805: warning: ‘NSImage’ may not respond to ‘-drawInRect:’ cocoa_window.m:1811: warning: ISO C90 forbids mixed declarations and code cocoa_window.m: In function ‘-[WineWindow miniaturize:]’: cocoa_window.m:2031: warning: ISO C90 forbids mixed declarations and code cocoa_window.m: In function ‘-[WineWindow windowWillResize:toSize:]’: cocoa_window.m:2413: warning: ISO C90 forbids mixed declarations and code cocoa_window.m: In function ‘-[WineWindow draggingEntered:]’: cocoa_window.m:2554: warning: ‘WineWindow’ may not respond to ‘-draggingUpdated:’ cocoa_window.m:2554: warning: return makes integer from pointer without a cast make[1]: *** [cocoa_window.o] Error 1 make: *** [dlls/winemac.drv] Error 2
Hi,
On Nov 6, 2015, at 3:20 AM, Huw Davies huw@codeweavers.com wrote:
This doesn't build for me on 10.7:
gcc -m32 -c -o cocoa_window.o cocoa_window.m -I. -I../../include -D__WINESRC__ -D_REENTRANT -fPIC -Wall -pipe \ -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wstrict-prototypes \ -Wwrite-strings -Wpointer-arith -gdwarf-2 -fno-omit-frame-pointer -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 cocoa_window.m:161: error: expected specifier-qualifier-list before ‘CVDisplayLinkRef’ …
Hmm. Does it work if you add #import <CoreVideo/CoreVideo.h> to the imports at the top of cocoa_window.m or, there are still issues, to cocoa_window.h?
Thanks for checking!
-Ken
On Fri, Nov 06, 2015 at 05:11:15AM -0600, Ken Thomases wrote:
Hmm. Does it work if you add #import <CoreVideo/CoreVideo.h> to the imports at the top of cocoa_window.m or, there are still issues, to cocoa_window.h?
It's a little less bad ;-/
gcc -m32 -c -o cocoa_window.o cocoa_window.m -I. -I../../include -D__WINESRC__ -D_REENTRANT -fPIC -Wall -pipe \ -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wstrict-prototypes \ -Wwrite-strings -Wpointer-arith -gdwarf-2 -fno-omit-frame-pointer -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 cocoa_window.m: In function ‘+[WineWindow createWindowWithFeatures:windowFrame:hwnd:queue:]’: cocoa_window.m:690: error: request for member ‘autodisplay’ in something not a structure or union cocoa_window.m: In function ‘-[WineWindow orderBelow:orAbove:activate:]’: cocoa_window.m:1311: warning: ‘WineWindow’ may not respond to ‘-checkWineDisplayLink’ cocoa_window.m:1311: warning: (Messages without a matching method signature cocoa_window.m:1311: warning: will be assumed to return ‘id’ and accept cocoa_window.m:1311: warning: ‘...’ as arguments.) cocoa_window.m:1330: warning: ‘WineWindow’ may not respond to ‘-checkWineDisplayLink’ cocoa_window.m: In function ‘-[WineWindow doOrderOut]’: cocoa_window.m:1371: warning: ISO C90 forbids mixed declarations and code cocoa_window.m:1373: warning: ‘WineWindow’ may not respond to ‘-grabDockIconSnapshotFromWindow:force:’ cocoa_window.m:1384: warning: ‘WineWindow’ may not respond to ‘-checkWineDisplayLink’ cocoa_window.m: In function ‘-[WineWindow checkWineDisplayLink]’: cocoa_window.m:1683: warning: ‘WineWindow’ may not respond to ‘-isEmptyShaped’ cocoa_window.m:1690: warning: ISO C90 forbids mixed declarations and code cocoa_window.m:1695: warning: ISO C90 forbids mixed declarations and code cocoa_window.m: In function ‘-[WineWindow grabDockIconSnapshotFromWindow:force:]’: cocoa_window.m:1745: warning: ISO C90 forbids mixed declarations and code cocoa_window.m:1762: warning: ISO C90 forbids mixed declarations and code cocoa_window.m:1775: warning: ISO C90 forbids mixed declarations and code cocoa_window.m:1782: warning: ISO C90 forbids mixed declarations and code cocoa_window.m:1786: warning: ISO C90 forbids mixed declarations and code cocoa_window.m:1789: warning: ISO C90 forbids mixed declarations and code cocoa_window.m:1806: warning: ‘NSImage’ may not respond to ‘-drawInRect:’ cocoa_window.m:1812: warning: ISO C90 forbids mixed declarations and code cocoa_window.m: In function ‘-[WineWindow miniaturize:]’: cocoa_window.m:2032: warning: ISO C90 forbids mixed declarations and code cocoa_window.m: In function ‘-[WineWindow windowWillResize:toSize:]’: cocoa_window.m:2414: warning: ISO C90 forbids mixed declarations and code cocoa_window.m: In function ‘-[WineWindow draggingEntered:]’: cocoa_window.m:2555: warning: ‘WineWindow’ may not respond to ‘-draggingUpdated:’ cocoa_window.m:2555: warning: return makes integer from pointer without a cast
On Fri, Nov 06, 2015 at 11:17:26AM +0000, Huw Davies wrote:
On Fri, Nov 06, 2015 at 05:11:15AM -0600, Ken Thomases wrote:
Hmm. Does it work if you add #import <CoreVideo/CoreVideo.h> to the imports at the top of cocoa_window.m or, there are still issues, to cocoa_window.h?
It's a little less bad ;-/
gcc -m32 -c -o cocoa_window.o cocoa_window.m -I. -I../../include -D__WINESRC__ -D_REENTRANT -fPIC -Wall -pipe \ -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wstrict-prototypes \ -Wwrite-strings -Wpointer-arith -gdwarf-2 -fno-omit-frame-pointer -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 cocoa_window.m: In function ‘+[WineWindow createWindowWithFeatures:windowFrame:hwnd:queue:]’: cocoa_window.m:690: error: request for member ‘autodisplay’ in something not a structure or union
And I guess this explains why:
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Applic...
Huw.
On Nov 6, 2015, at 5:24 AM, Huw Davies huw@codeweavers.com wrote:
On Fri, Nov 06, 2015 at 11:17:26AM +0000, Huw Davies wrote:
On Fri, Nov 06, 2015 at 05:11:15AM -0600, Ken Thomases wrote:
Hmm. Does it work if you add #import <CoreVideo/CoreVideo.h> to the imports at the top of cocoa_window.m or, there are still issues, to cocoa_window.h?
It's a little less bad ;-/
gcc -m32 -c -o cocoa_window.o cocoa_window.m -I. -I../../include -D__WINESRC__ -D_REENTRANT -fPIC -Wall -pipe \ -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wstrict-prototypes \ -Wwrite-strings -Wpointer-arith -gdwarf-2 -fno-omit-frame-pointer -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 cocoa_window.m: In function ‘+[WineWindow createWindowWithFeatures:windowFrame:hwnd:queue:]’: cocoa_window.m:690: error: request for member ‘autodisplay’ in something not a structure or union
And I guess this explains why:
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Applic...
Sort of, but not really. The "autodisplay" property is not really new. It's been around forever, but it used to be an "informal" property. That is, there were just declarations of the getter and setter methods. It has since been converted to a "declared" property using the @property syntax. In some cases, the documentation erroneously indicates that the property dates from the conversion.
I have an old 10.6 SDK and it has -setAutodisplay: which is all that should be necessary for that assignment to work. However, the compiler may be too old to understand that (although I'm sure I rely on that elsewhere in the Mac driver).
For that particular line, you can change "window.autodisplay = NO" to "[window setAutodisplay:NO]" and it should stop complaining.
Newer compilers also don't require method definitions (or declarations) to appear before they are used. I can fix some of those warnings by reordering the code but it's probably not necessary for correct operation.
I also no longer get the "ISO C90 forbids mixed declarations and code" with my tools. That may be a Clang vs. GCC thing. We should maybe consider compiling Objective-C without that warning enabled, since we don't have the same compatibility concerns as other parts of Wine.
Anyway, if you don't mind testing the -setAutodisplay: change, I can submit a revised patch which will build and work even if there are more warnings than we might like. Thanks, again.
cocoa_window.m:1806: warning: ‘NSImage’ may not respond to ‘-drawInRect:’
This is a real issue that I was already aware of and will be fixing soon.
-Ken
On Nov 6, 2015, at 5:58 AM, Ken Thomases ken@codeweavers.com wrote:
Anyway, if you don't mind testing the -setAutodisplay: change, I can submit a revised patch which will build and work even if there are more warnings than we might like.
Never mind, I'm testing on our 10.6 build system.
Thanks again, Ken