From 5b780063e1d96930279bef3d17e3f58f8e6469c0 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 30 Jul 2014 14:14:19 -0400 Subject: [PATCH] Make SDL_SysWMinfo usable on Mac/iOS with ARC enabled (thanks, Alex!). Fixes Bugzilla #2641. --- include/SDL_syswm.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/SDL_syswm.h b/include/SDL_syswm.h index 715f2c0583a13..c81cd48decba5 100644 --- a/include/SDL_syswm.h +++ b/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)