diff -r 5ffe4647b1a2 Xcode/SDL/SDL.xcodeproj/project.pbxproj --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj Sat Nov 21 14:13:26 2020 -0800 +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj Sun Nov 22 22:47:39 2020 -0700 @@ -10391,7 +10391,8 @@ INFOPLIST_FILE = "Info-Framework.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.6; + MACOSX_DEPLOYMENT_TARGET = 10.9; + "MACOSX_DEPLOYMENT_TARGET[arch=i386]" = 10.6; PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL2; PRODUCT_NAME = SDL2; STRIP_STYLE = "non-global"; @@ -10470,7 +10471,8 @@ INFOPLIST_FILE = "Info-Framework.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.6; + MACOSX_DEPLOYMENT_TARGET = 10.9; + "MACOSX_DEPLOYMENT_TARGET[arch=i386]" = 10.6; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL2; PRODUCT_NAME = SDL2; diff -r 5ffe4647b1a2 include/SDL_config_macosx.h --- a/include/SDL_config_macosx.h Sat Nov 21 14:13:26 2020 -0800 +++ b/include/SDL_config_macosx.h Sun Nov 22 22:47:39 2020 -0700 @@ -144,7 +144,9 @@ #define SDL_JOYSTICK_HIDAPI 1 #define SDL_JOYSTICK_IOKIT 1 #define SDL_JOYSTICK_VIRTUAL 1 +#if !(defined(__i386__) && TARGET_OS_OSX) && defined(MAC_OS_VERSION_11_0) #define SDL_JOYSTICK_MFI 1 +#endif #define SDL_HAPTIC_IOKIT 1 /* Enable the dummy sensor driver */ diff -r 5ffe4647b1a2 src/joystick/iphoneos/SDL_mfijoystick.m --- a/src/joystick/iphoneos/SDL_mfijoystick.m Sat Nov 21 14:13:26 2020 -0800 +++ b/src/joystick/iphoneos/SDL_mfijoystick.m Sun Nov 22 22:47:39 2020 -0700 @@ -59,6 +59,16 @@ #include #include +/* Helpful macros + */ +#if __has_feature(objc_arc) +#define WEAK_SELF() __weak typeof(self) weakSelf = self +#define STRONG_SELF() typeof(self) _this = weakSelf +#else +#define WEAK_SELF() typeof(self) weakSelf = self +#define STRONG_SELF() typeof(self) _this = weakSelf +#endif + /* remove compilation warnings for strict builds by defining these selectors, even though * they are only ever used indirectly through objc_msgSend */ @@ -1057,9 +1067,9 @@ return nil; } - __weak typeof(self) weakSelf = self; + WEAK_SELF(); self->engine.stoppedHandler = ^(CHHapticEngineStoppedReason stoppedReason) { - SDL_RumbleMotor *_this = weakSelf; + STRONG_SELF(); if (_this == nil) { return; } @@ -1068,7 +1078,7 @@ _this->engine = nil; }; self->engine.resetHandler = ^{ - SDL_RumbleMotor *_this = weakSelf; + STRONG_SELF(); if (_this == nil) { return; }