Преглед изворни кода

Make SDL_SysWMinfo usable on Mac/iOS with ARC enabled (thanks, Alex!).

Fixes Bugzilla #2641.
Ryan C. Gordon пре 11 година
родитељ
комит
5b780063e1
1 измењених фајлова са 10 додато и 2 уклоњено
  1. 10 2
      include/SDL_syswm.h

+ 10 - 2
include/SDL_syswm.h

@@ -208,13 +208,21 @@ struct SDL_SysWMinfo
 #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)