From 44b39fe097bad7c33bdbc0a36a34739f70d72233 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 3 Jan 2026 13:53:06 +1000 Subject: [PATCH] Rename SDL2 backend source files. --- CMakeLists.txt | 6 +++--- examples/custom_backend.c | 4 ++-- .../backends/{sdl/backend_sdl.c => sdl2/miniaudio_sdl2.c} | 2 +- .../backends/{sdl/backend_sdl.h => sdl2/miniaudio_sdl2.h} | 0 tests/deviceio/deviceio.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) rename extras/backends/{sdl/backend_sdl.c => sdl2/miniaudio_sdl2.c} (99%) rename extras/backends/{sdl/backend_sdl.h => sdl2/miniaudio_sdl2.h} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 87402e49..ef6e8130 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -648,12 +648,12 @@ if(NOT MINIAUDIO_NO_DEVICEIO) if(NOT MINIAUDIO_NO_SDL2) add_library(miniaudio_sdl2 STATIC - extras/backends/sdl/backend_sdl.c - extras/backends/sdl/backend_sdl.h + extras/backends/sdl2/miniaudio_sdl2.c + extras/backends/sdl2/miniaudio_sdl2.h ) list(APPEND LIBS_TO_INSTALL miniaudio_sdl2) - install(FILES extras/backends/sdl/backend_sdl.h DESTINATION include/miniaudio/extras/backends/sdl2) + install(FILES extras/backends/sdl2/miniaudio_sdl2.h DESTINATION include/miniaudio/extras/backends/sdl2) target_include_directories(miniaudio_sdl2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/extras/backends/sdl2) target_compile_options (miniaudio_sdl2 PRIVATE ${COMPILE_OPTIONS}) diff --git a/examples/custom_backend.c b/examples/custom_backend.c index d5d49596..e6ce60e1 100644 --- a/examples/custom_backend.c +++ b/examples/custom_backend.c @@ -13,7 +13,7 @@ backends would actually get hit. By default, the `ma_backend_custom` backend is #include "../miniaudio.c" /* We're using SDL for this example. To use this in your own program, you need to include backend_sdl.h after miniaudio.h. */ -#include "../extras/backends/sdl/backend_sdl.h" +#include "../extras/backends/sdl2/miniaudio_sdl2.h" #ifdef __EMSCRIPTEN__ #include @@ -146,4 +146,4 @@ int main(int argc, char** argv) } /* We put the SDL implementation here just to simplify the compilation process. This way you need only compile custom_backend.c. */ -#include "../extras/backends/sdl/backend_sdl.c" +#include "../extras/backends/sdl2/miniaudio_sdl2.c" diff --git a/extras/backends/sdl/backend_sdl.c b/extras/backends/sdl2/miniaudio_sdl2.c similarity index 99% rename from extras/backends/sdl/backend_sdl.c rename to extras/backends/sdl2/miniaudio_sdl2.c index 765a73d1..195befd1 100644 --- a/extras/backends/sdl/backend_sdl.c +++ b/extras/backends/sdl2/miniaudio_sdl2.c @@ -12,7 +12,7 @@ which requires the `-s USE_SDL=2` option. #include "../../../miniaudio.h" #endif -#include "backend_sdl.h" +#include "miniaudio_sdl2.h" #include /* memset() */ #include diff --git a/extras/backends/sdl/backend_sdl.h b/extras/backends/sdl2/miniaudio_sdl2.h similarity index 100% rename from extras/backends/sdl/backend_sdl.h rename to extras/backends/sdl2/miniaudio_sdl2.h diff --git a/tests/deviceio/deviceio.c b/tests/deviceio/deviceio.c index 28ca0cd2..2d9637f8 100644 --- a/tests/deviceio/deviceio.c +++ b/tests/deviceio/deviceio.c @@ -49,7 +49,7 @@ If multiple backends are specified, the priority will be based on the order in w are specified the last one on the command line will have priority. */ #include "../common/common.c" -#include "../../extras/backends/sdl/backend_sdl.c" +#include "../../extras/backends/sdl2/miniaudio_sdl2.c" #if defined(MA_TESTS_INCLUDE_PIPEWIRE) #include "../../extras/backends/pipewire/miniaudio_pipewire.h"