From 542a76c490cee7359f9c5116248977cab72b7b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 13 Oct 2016 12:57:28 +0200 Subject: macOS: Remove workaround for including AppKit.h with slots defined MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The workaround doesn't seem to be needed anymore, and wasn't applied uniformly anyways. If it turns out AppKit still needs this workaround we should add CONFIG += no_keywords to cocoa.pro, instead of trying to wrap every single include of AppKit in a undef slots dance. Change-Id: Ia1b15137c03abcc92f0dd246796622772e99ca68 Reviewed-by: Morten Johan Sørvig --- .../platforms/cocoa/qcocoaeventdispatcher.mm | 1 - src/plugins/platforms/cocoa/qcocoaglcontext.h | 1 - src/plugins/platforms/cocoa/qmacclipboard.h | 2 - src/plugins/platforms/cocoa/qmacdefines_mac.h | 57 +++++++++------------- src/plugins/platforms/cocoa/qt_mac_p.h | 4 +- 5 files changed, 25 insertions(+), 40 deletions(-) (limited to 'src/plugins/platforms/cocoa') diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm index 5c27cf8059..b2b9fe2c1e 100644 --- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm +++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm @@ -85,7 +85,6 @@ #include "private/qguiapplication_p.h" #include -#undef slots #include #include diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.h b/src/plugins/platforms/cocoa/qcocoaglcontext.h index 5bee708b76..1a66cec0e3 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.h +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.h @@ -45,7 +45,6 @@ #include #include -#undef slots #include QT_BEGIN_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qmacclipboard.h b/src/plugins/platforms/cocoa/qmacclipboard.h index a3abacf849..2ee0cb91e4 100644 --- a/src/plugins/platforms/cocoa/qmacclipboard.h +++ b/src/plugins/platforms/cocoa/qmacclipboard.h @@ -43,8 +43,6 @@ #include #include -#undef slots - #import QT_BEGIN_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qmacdefines_mac.h b/src/plugins/platforms/cocoa/qmacdefines_mac.h index e27f805fca..9e229b8dcb 100644 --- a/src/plugins/platforms/cocoa/qmacdefines_mac.h +++ b/src/plugins/platforms/cocoa/qmacdefines_mac.h @@ -93,42 +93,31 @@ typedef signed int OSStatus; typedef signed long OSStatus; #endif +typedef struct OpaqueEventHandlerCallRef * EventHandlerCallRef; +typedef struct OpaqueEventRef * EventRef; +typedef struct OpaqueMenuRef * MenuRef; +typedef struct OpaquePasteboardRef* PasteboardRef; +typedef struct OpaqueRgnHandle * RgnHandle; +typedef const struct __HIShape *HIShapeRef; +typedef struct __HIShape *HIMutableShapeRef; +typedef struct CGRect CGRect; +typedef struct CGImage *CGImageRef; +typedef struct CGContext *CGContextRef; +typedef struct GDevice * GDPtr; +typedef GDPtr * GDHandle; +typedef struct OpaqueIconRef * IconRef; + #ifdef __OBJC__ -# ifdef slots -# define old_slots slots -# undef slots -# endif -#include -# ifdef old_slots -# undef slots -# define slots -# undef old_slots -# endif +typedef NSWindow* OSWindowRef; +typedef NSView *OSViewRef; +typedef NSMenu *OSMenuRef; +typedef NSEvent *OSEventRef; +#else +typedef void *OSWindowRef; +typedef void *OSViewRef; +typedef void *OSMenuRef; +typedef void *OSEventRef; #endif - typedef struct OpaqueEventHandlerCallRef * EventHandlerCallRef; - typedef struct OpaqueEventRef * EventRef; - typedef struct OpaqueMenuRef * MenuRef; - typedef struct OpaquePasteboardRef* PasteboardRef; - typedef struct OpaqueRgnHandle * RgnHandle; - typedef const struct __HIShape *HIShapeRef; - typedef struct __HIShape *HIMutableShapeRef; - typedef struct CGRect CGRect; - typedef struct CGImage *CGImageRef; - typedef struct CGContext *CGContextRef; - typedef struct GDevice * GDPtr; - typedef GDPtr * GDHandle; - typedef struct OpaqueIconRef * IconRef; -# ifdef __OBJC__ - typedef NSWindow* OSWindowRef; - typedef NSView *OSViewRef; - typedef NSMenu *OSMenuRef; - typedef NSEvent *OSEventRef; -# else - typedef void *OSWindowRef; - typedef void *OSViewRef; - typedef void *OSMenuRef; - typedef void *OSEventRef; -# endif typedef PasteboardRef OSPasteboardRef; typedef struct AEDesc AEDescList; diff --git a/src/plugins/platforms/cocoa/qt_mac_p.h b/src/plugins/platforms/cocoa/qt_mac_p.h index ce17919e8c..fdcf3bcdd3 100644 --- a/src/plugins/platforms/cocoa/qt_mac_p.h +++ b/src/plugins/platforms/cocoa/qt_mac_p.h @@ -51,13 +51,13 @@ // We mean it. // -#include "qmacdefines_mac.h" - #ifdef __OBJC__ #include #include #endif +#include "qmacdefines_mac.h" + #include #include "QtCore/qglobal.h" -- cgit v1.2.3