libsdl-org / SDL_mixer

An audio mixer that supports various file formats for Simple Directmedia Layer.
zlib License
433 stars 146 forks source link

API change in SDL3.0's SDL_audio.h breaks compilation #484

Closed etna closed 1 year ago

etna commented 1 year ago

In a recent change to SDL3/SDL_audio.h, extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev, int pause_on); has been changed to extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev);

Commit is https://github.com/libsdl-org/SDL/commit/93e2903ac550b9f0ac034af4174658c1f5ffbc04

This breaks compilation of SDL_mixer on src/mixer.c, which is still using _int pauseon in the older SDL_audio.h and results in the following errors:

/home/etna/Tmpbuild/SDL_mixer/src/mixer.c:535:40: error: too many arguments to function call, expected single argument 'dev', have 2 arguments
    SDL_PauseAudioDevice(audio_device, 0);
    ~~~~~~~~~~~~~~~~~~~~               ^
/home/etna/Runtime/Deps/SDL2-Build07Jan2022/include/SDL3/SDL_audio.h:640:30: note: 'SDL_PauseAudioDevice' declared here
extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev);
                             ^
/home/etna/Tmpbuild/SDL_mixer/src/mixer.c:550:40: error: too many arguments to function call, expected single argument 'dev', have 2 arguments
    SDL_PauseAudioDevice(audio_device, pause_on);
    ~~~~~~~~~~~~~~~~~~~~               ^~~~~~~~
/home/etna/Runtime/Deps/SDL2-Build07Jan2022/include/SDL3/SDL_audio.h:640:30: note: 'SDL_PauseAudioDevice' declared here
extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev);

Please help to update SDL_mixer to use the updated API.

Thank you.

1bsyl commented 1 year ago

fix done ! https://github.com/libsdl-org/SDL_mixer/commit/313242a47a9baed4b47c8c5add6eae3ef0f852dc