diff options
author | Tor Lillqvist <tml@iki.fi> | 2011-09-28 15:44:29 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2011-09-28 17:43:32 +0300 |
commit | 0e0393b06a0546335664884069d2e5388832b0f1 (patch) | |
tree | 74cb3561e082b1ac2bdad2facb374283cf0146fc /vcl/aqua | |
parent | 82129a0d351cb26203fb8574fbc72c8e91fa9e42 (diff) |
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?
Diffstat (limited to 'vcl/aqua')
-rw-r--r-- | vcl/aqua/source/app/vclnsapp.mm | 15 |
1 files changed, 14 insertions, 1 deletions
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 <objc/objc-runtime.h> #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; } } |