Make SDL_SysWMinfo usable on Mac/iOS with ARC enabled (thanks, Alex!).
authorRyan C. Gordon <icculus@icculus.org>
Wed, 30 Jul 2014 14:14:19 -0400
changeset 9034 d6464107048c
parent 9033 335b60fba5c2
child 9037 e9d67ac0c6f8
Make SDL_SysWMinfo usable on Mac/iOS with ARC enabled (thanks, Alex!). Fixes Bugzilla #2641.
include/SDL_syswm.h
--- a/include/SDL_syswm.h	Wed Jul 30 14:12:54 2014 -0400
+++ b/include/SDL_syswm.h	Wed Jul 30 14:14:19 2014 -0400
@@ -208,13 +208,21 @@
 #if defined(SDL_VIDEO_DRIVER_COCOA)
         struct
         {
-            NSWindow *window;           /* The Cocoa window */
+#if defined(__OBJC__) && __has_feature(objc_arc)
+            NSWindow __unsafe_unretained *window; /* The Cocoa window */
+#else
+            NSWindow *window;                     /* The Cocoa window */
+#endif
         } cocoa;
 #endif
 #if defined(SDL_VIDEO_DRIVER_UIKIT)
         struct
         {
-            UIWindow *window;           /* The UIKit window */
+#if defined(__OBJC__) && __has_feature(objc_arc)
+            UIWindow __unsafe_unretained *window; /* The UIKit window */
+#else
+            UIWindow *window;                     /* The UIKit window */
+#endif
         } uikit;
 #endif
 #if defined(SDL_VIDEO_DRIVER_WAYLAND)