From 225fb12ae13b70689bcb8c0b42bf061120fefcc4 Mon Sep 17 00:00:00 2001
From: DominusExult <[EMAIL REDACTED]>
Date: Sun, 15 Feb 2026 17:21:32 +0100
Subject: [PATCH] Hide deprecation message for controllerPausedHandler (which
is still needed for backwards compatibility)
---
src/joystick/apple/SDL_mfijoystick.m | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/joystick/apple/SDL_mfijoystick.m b/src/joystick/apple/SDL_mfijoystick.m
index 2ef055ecccb3a..606aa28cfb6be 100644
--- a/src/joystick/apple/SDL_mfijoystick.m
+++ b/src/joystick/apple/SDL_mfijoystick.m
@@ -706,7 +706,10 @@ static void IOS_AddJoystickDevice(GCController *controller)
// These were explicitly retained in the struct, so they should be explicitly released before freeing the struct.
if (device->controller) {
GCController *controller = CFBridgingRelease((__bridge CFTypeRef)(device->controller));
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
controller.controllerPausedHandler = nil;
+#pragma clang diagnostic pop
device->controller = nil;
}
if (device->axes) {
@@ -911,11 +914,14 @@ static bool IOS_JoystickOpen(SDL_Joystick *joystick, int device_index)
#ifdef SDL_JOYSTICK_MFI
if (device->pause_button_index >= 0) {
GCController *controller = device->controller;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
controller.controllerPausedHandler = ^(GCController *c) {
if (joystick->hwdata) {
joystick->hwdata->pause_button_pressed = SDL_GetTicks();
}
};
+#pragma clang diagnostic pop
}
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) {
GCController *controller = device->controller;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
controller.controllerPausedHandler = nil;
+#pragma clang diagnostic pop
controller.playerIndex = -1;
if (@available(macOS 11.0, iOS 14.0, tvOS 14.0, *)) {