From 705616f40dbf9a2657025974367b2edc72f211e4 Mon Sep 17 00:00:00 2001
From: Guillaume Pasero <guillaume.pasero@c-s.fr>
Date: Wed, 11 Apr 2018 18:30:38 +0200
Subject: [PATCH] SuperBuild: other fixes for macosx

---
 .../patches/QT5/qt5-2-undefVar-macx.diff      | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/SuperBuild/patches/QT5/qt5-2-undefVar-macx.diff b/SuperBuild/patches/QT5/qt5-2-undefVar-macx.diff
index 9a9e52ca67..7fcdd42a69 100644
--- a/SuperBuild/patches/QT5/qt5-2-undefVar-macx.diff
+++ b/SuperBuild/patches/QT5/qt5-2-undefVar-macx.diff
@@ -9,3 +9,62 @@
      { qSwap(value, other.value); }
      QAppleRefCounted &operator=(const QAppleRefCounted &other)
      { QAppleRefCounted copy(other); swap(copy); return *this; }
+--- qt-everywhere-src-5.10.1/qtbase/src/corelib/kernel/qcore_foundation.mm	2018-02-08 19:24:48.000000000 +0100
++++ QT5/qtbase/src/corelib/kernel/qcore_foundation.mm	2018-04-11 17:03:51.018596589 +0200
+@@ -488,7 +488,7 @@
+ */
+ NSTimeZone *QTimeZone::toNSTimeZone() const
+ {
+-    return [static_cast<NSTimeZone *>(toCFTimeZone()) autorelease];
++    return [((NSTimeZone *) toCFTimeZone()) autorelease];
+ }
+ #endif
+ 
+--- qt-everywhere-src-5.10.1/qtbase/src/platformsupport/clipboard/qmacmime.mm	2018-02-08 19:24:48.000000000 +0100
++++ QT5/qtbase/src/platformsupport/clipboard/qmacmime.mm	2018-04-11 17:13:54.799982725 +0200
+@@ -853,11 +853,11 @@
+ 
+     QImage img = qvariant_cast<QImage>(variant);
+     NSDictionary *props = @{
+-        static_cast<NSString *>(kCGImagePropertyPixelWidth) : [NSNumber numberWithInt:img.width()],
+-        static_cast<NSString *>(kCGImagePropertyPixelHeight) : [NSNumber numberWithInt:img.height()]
++        ((NSString *) kCGImagePropertyPixelWidth) : [NSNumber numberWithInt:img.width()],
++        ((NSString *) kCGImagePropertyPixelHeight) : [NSNumber numberWithInt:img.height()]
+     };
+ 
+-    CGImageDestinationAddImage(imageDestination, qt_mac_toCGImage(img), static_cast<CFDictionaryRef>(props));
++    CGImageDestinationAddImage(imageDestination, qt_mac_toCGImage(img), (CFDictionaryRef) props);
+     CGImageDestinationFinalize(imageDestination);
+ 
+     return QList<QByteArray>() << QByteArray::fromCFData(data);
+--- qt-everywhere-src-5.10.1/qtbase/src/plugins/platforms/cocoa/qcocoawindow.mm	2018-02-08 19:24:48.000000000 +0100
++++ QT5/qtbase/src/plugins/platforms/cocoa/qcocoawindow.mm	2018-04-11 17:36:09.563188504 +0200
+@@ -1684,7 +1684,7 @@
+ 
+     if (!m_drawContentBorderGradient) {
+         window.styleMask = window.styleMask & ~NSTexturedBackgroundWindowMask;
+-        [window.contentView.superview setNeedsDisplay:YES];
++        [[[window contentView] superview] setNeedsDisplay:YES];
+         window.titlebarAppearsTransparent = NO;
+         return;
+     }
+--- qt-everywhere-src-5.10.1/qtbase/src/plugins/platforms/cocoa/qnswindow.mm	2018-02-08 19:24:48.000000000 +0100
++++ QT5/qtbase/src/plugins/platforms/cocoa/qnswindow.mm	2018-04-11 18:27:43.952730012 +0200
+@@ -231,7 +231,7 @@
+     if (pw->frameStrutEventsEnabled() && isMouseEvent(theEvent)) {
+         NSPoint loc = [theEvent locationInWindow];
+         NSRect windowFrame = [self convertRectFromScreen:self.frame];
+-        NSRect contentFrame = self.contentView.frame;
++        NSRect contentFrame = [[self contentView] frame];
+         if (NSMouseInRect(loc, windowFrame, NO) && !NSMouseInRect(loc, contentFrame, NO))
+             [qnsview_cast(pw->view()) handleFrameStrutMouseEvent:theEvent];
+     }
+@@ -260,7 +260,7 @@
+ + (void)applicationActivationChanged:(NSNotification*)notification
+ {
+     const id sender = self;
+-    NSEnumerator<NSWindow*> *windowEnumerator = nullptr;
++    NSEnumerator *windowEnumerator = nullptr;
+     NSApplication *application = [NSApplication sharedApplication];
+ 
+ #if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_12)
-- 
GitLab