Browse Source

Fix #15500: deprecation warning on Android for slCreateEngine

Brenton Bostick 3 tháng trước cách đây
mục cha
commit
e8127a9a11
1 tập tin đã thay đổi với 9 bổ sung0 xóa
  1. 9 0
      src/audio/openslES/SDL_openslES.c

+ 9 - 0
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