From: Josep Torra Date: Sat, 20 May 2017 10:34:27 +0000 (+0200) Subject: examples: fix macOS 9.12 deprecation warnings X-Git-Tag: 1.19.3~511^2~1989^2~98 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c020f421e19cfb1bb8012683b54dc18aaa92f452;p=platform%2Fupstream%2Fgstreamer.git examples: fix macOS 9.12 deprecation warnings Add #defines to allow older versions of macOS to use the new constant names. --- diff --git a/tests/examples/gl/cocoa/cocoa-videooverlay.m b/tests/examples/gl/cocoa/cocoa-videooverlay.m index cc209d8..75814a7 100755 --- a/tests/examples/gl/cocoa/cocoa-videooverlay.m +++ b/tests/examples/gl/cocoa/cocoa-videooverlay.m @@ -22,6 +22,14 @@ #include #include +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12 +#define NSEventMaskAny NSAnyEventMask +#define NSWindowStyleMaskTitled NSTitledWindowMask +#define NSWindowStyleMaskClosable NSClosableWindowMask +#define NSWindowStyleMaskResizable NSResizableWindowMask +#define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask +#endif + /* ============================================================= */ /* */ /* MainWindow */ @@ -48,7 +56,8 @@ m_isClosed = FALSE; self = [super initWithContentRect: contentRect - styleMask: (NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask | NSMiniaturizableWindowMask) + styleMask: (NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | + NSWindowStyleMaskResizable | NSWindowStyleMaskMiniaturizable) backing: NSBackingStoreBuffered defer: NO screen: nil]; [self setReleasedWhenClosed:NO]; @@ -211,7 +220,7 @@ int main(int argc, char **argv) [window orderFront:window]; while (![window isClosed]) { - NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask + NSEvent *event = [NSApp nextEventMatchingMask:NSEventMaskAny untilDate:[NSDate dateWithTimeIntervalSinceNow:1] inMode:NSDefaultRunLoopMode dequeue:YES]; if (event)