From e8127a9a11a5d6d720062612d15ddc2c9c812648 Mon Sep 17 00:00:00 2001
From: Brenton Bostick <[EMAIL REDACTED]>
Date: Sun, 3 May 2026 10:58:49 -0400
Subject: [PATCH] Fix #15500: deprecation warning on Android for slCreateEngine
---
src/audio/openslES/SDL_openslES.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/audio/openslES/SDL_openslES.c b/src/audio/openslES/SDL_openslES.c
index 0f49585d55f63..409d07150f9ce 100644
--- a/src/audio/openslES/SDL_openslES.c
+++ b/src/audio/openslES/SDL_openslES.c
@@ -33,6 +33,11 @@
#include <SLES/OpenSLES_Android.h>
#include <android/log.h>
+// OpenSL ES is deprecated, but we still support it for now.
+#ifdef HAVE_GCC_DIAGNOSTIC_PRAGMA
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif // HAVE_GCC_DIAGNOSTIC_PRAGMA
#define NUM_BUFFERS 2 // -- Don't lower this!
@@ -805,4 +810,8 @@ void OPENSLES_PauseDevices(void)
}
}
+#ifdef HAVE_GCC_DIAGNOSTIC_PRAGMA
+#pragma GCC diagnostic pop
+#endif // HAVE_GCC_DIAGNOSTIC_PRAGMA
+
#endif // SDL_AUDIO_DRIVER_OPENSLES