Skip to content

Commit

Permalink
ui/cocoa: Declare that QemuCocoaAppController implements NSApplicatio…
Browse files Browse the repository at this point in the history
…nDelegate

Our class QemuCocoaAppController implements the NSApplicationDelegate
interface, and we pass an object of this class to [NSApp setDelegate].
However, we weren't declaring in the class definition that we implemented
this interface; in OSX 10.10 this provokes the following (slighly
misleading) warning:
ui/cocoa.m:1031:24: warning: sending 'QemuCocoaAppController *' to parameter of
      incompatible type 'id<NSFileManagerDelegate>'
    [NSApp setDelegate:appController];
                       ^~~~~~~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSFileManager.h:109:47:
note: passing argument to parameter 'delegate' here
@Property (assign) id <NSFileManagerDelegate> delegate NS_AVAILABLE(10_5,
2_0);
                                              ^

Annoyingly, this interface wasn't formally defined until OSX 10.6, so we
have to surround the relevant part of the @interface line with an ifdef.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1431296361-16981-5-git-send-email-peter.maydell@linaro.org
  • Loading branch information
pm215 committed May 19, 2015
1 parent de1aade commit 2a4c8c5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ui/cocoa.m
Expand Up @@ -784,6 +784,9 @@ - (QEMUScreen) gscreen {return screen;}
------------------------------------------------------
*/
@interface QemuCocoaAppController : NSObject
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
<NSApplicationDelegate>
#endif
{
}
- (void)startEmulationWithArgc:(int)argc argv:(char**)argv;
Expand Down

0 comments on commit 2a4c8c5

Please sign in to comment.