From 0e0393b06a0546335664884069d2e5388832b0f1 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 28 Sep 2011 15:44:29 +0300 Subject: WaE: 'NSWindow' may not respond to '-windowShouldClose:' We get this warning when compiling with g++ 4.2.1 from the 10.6 SDK. As far as I see there is no command-line option to get rid of it, and thus also no pragma to avoid it just for the lines of code in question. So to make it compile with -Werror also using this compiler/SDK, expand the Objective-C message call syntactic sugar into a objc_msgSend() call instead. That should be equivalent, shouldn't it? --- vcl/aqua/source/app/vclnsapp.mm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'vcl/aqua/source/app/vclnsapp.mm') diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm index 2424d373b24e..612aca6e37bb 100644 --- a/vcl/aqua/source/app/vclnsapp.mm +++ b/vcl/aqua/source/app/vclnsapp.mm @@ -44,6 +44,7 @@ #include "impimagetree.hxx" #include "premac.h" +#include #import "Carbon/Carbon.h" #import "apple_remote/RemoteControl.h" #include "postmac.h" @@ -88,7 +89,19 @@ if( nModMask == NSCommandKeyMask && [[pEvent charactersIgnoringModifiers] isEqualToString: @"w"] ) { - [pFrame->getWindow() windowShouldClose: nil]; + // Note: gcc 4.2.1 (in the 10.6 SDK) tells us + // 'NSWindow' may not respond to + // '-windowShouldClose:' . Is that a bogus + // warning, or is this code bogus? No idea. + // Anyway, so that we can compile also against + // this SDK with -Werror, use objc_msgSend + // instead. + + // Instead of: + // [pFrame->getWindow() windowShouldClose: nil]; + // do: + objc_msgSend(pFrame->getWindow(), @selector(windowShouldClose:), nil); + return; } } -- cgit