Parcourir la source

Hide deprecation message for controllerPausedHandler (which is still needed for backwards compatibility)

DominusExult il y a 2 semaines
Parent
commit
225fb12ae1
1 fichiers modifiés avec 9 ajouts et 0 suppressions
  1. 9 0
      src/joystick/apple/SDL_mfijoystick.m

+ 9 - 0
src/joystick/apple/SDL_mfijoystick.m

@@ -706,7 +706,10 @@ static SDL_JoystickDeviceItem *IOS_RemoveJoystickDevice(SDL_JoystickDeviceItem *
         // These were explicitly retained in the struct, so they should be explicitly released before freeing the struct.
         // These were explicitly retained in the struct, so they should be explicitly released before freeing the struct.
         if (device->controller) {
         if (device->controller) {
             GCController *controller = CFBridgingRelease((__bridge CFTypeRef)(device->controller));
             GCController *controller = CFBridgingRelease((__bridge CFTypeRef)(device->controller));
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
             controller.controllerPausedHandler = nil;
             controller.controllerPausedHandler = nil;
+#pragma clang diagnostic pop
             device->controller = nil;
             device->controller = nil;
         }
         }
         if (device->axes) {
         if (device->axes) {
@@ -911,11 +914,14 @@ static bool IOS_JoystickOpen(SDL_Joystick *joystick, int device_index)
 #ifdef SDL_JOYSTICK_MFI
 #ifdef SDL_JOYSTICK_MFI
         if (device->pause_button_index >= 0) {
         if (device->pause_button_index >= 0) {
             GCController *controller = device->controller;
             GCController *controller = device->controller;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
             controller.controllerPausedHandler = ^(GCController *c) {
             controller.controllerPausedHandler = ^(GCController *c) {
               if (joystick->hwdata) {
               if (joystick->hwdata) {
                   joystick->hwdata->pause_button_pressed = SDL_GetTicks();
                   joystick->hwdata->pause_button_pressed = SDL_GetTicks();
               }
               }
             };
             };
+#pragma clang diagnostic pop
         }
         }
 
 
         if (@available(macOS 11.0, iOS 14.0, tvOS 14.0, *)) {
         if (@available(macOS 11.0, iOS 14.0, tvOS 14.0, *)) {
@@ -1559,7 +1565,10 @@ static void IOS_JoystickClose(SDL_Joystick *joystick)
 
 
         if (device->controller) {
         if (device->controller) {
             GCController *controller = device->controller;
             GCController *controller = device->controller;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
             controller.controllerPausedHandler = nil;
             controller.controllerPausedHandler = nil;
+#pragma clang diagnostic pop
             controller.playerIndex = -1;
             controller.playerIndex = -1;
 
 
             if (@available(macOS 11.0, iOS 14.0, tvOS 14.0, *)) {
             if (@available(macOS 11.0, iOS 14.0, tvOS 14.0, *)) {