From 6e827b1e21d3c1f30beb47e8ca37ec26ecc814b6 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 15 Aug 2012 23:52:18 -0400 Subject: [PATCH] Some minor SDL2 fixes. --- playsound/playsound.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/playsound/playsound.c b/playsound/playsound.c index 16456b7..be5a0d4 100644 --- a/playsound/playsound.c +++ b/playsound/playsound.c @@ -84,12 +84,18 @@ static void output_versions(const char *argv0) Sound_Version compiled; Sound_Version linked; SDL_version sdl_compiled; - const SDL_version *sdl_linked; + SDL_version sdl_linked_ver; + const SDL_version *sdl_linked = &sdl_linked_ver; SOUND_VERSION(&compiled); Sound_GetLinkedVersion(&linked); SDL_VERSION(&sdl_compiled); + + #if SDL_MAJOR_VERSION >= 2 + SDL_GetVersion(&sdl_linked_ver); + #else sdl_linked = SDL_Linked_Version(); + #endif fprintf(stdout, "%s version %d.%d.%d\n" @@ -728,10 +734,11 @@ static void report_filename(const char *filename) fprintf(stdout, "%s: Now playing [%s]...\n", icon, filename); +#if SDL_MAJOR_VERSION < 2 /* * Bleeding edge versions of SDL 1.2 can use this to set the * PulseAudio application name. It's a harmless no-op elsewhere, - * and 1.3 will probably have a formal API for this. + * and 2.0 will probably have a formal API for this. */ ptr = strrchr(filename, '/'); if (ptr != NULL) @@ -750,6 +757,7 @@ static void report_filename(const char *filename) SDL_WM_SetCaption(buf, icon); free(buf); } /* else */ +#endif } /* report_filename */