Browse files

AUDIO: Fix Compilation with Fluidsynth v1.1.6 or earlier.

The function signature for these functions was changed from (char *) to
(const char *) in the v1.1.7 release, so compiling against
Fluidsynth v1.1.6 or earlier requires the copying of the strings to
prevent compilation errors such as "error: invalid conversion from
'const char*' to 'char*'".

Normally, we would break compatibility with older versions as platforms
should be using the latest Fluidsynth v1.X release of v1.1.11.

However, since this is trivial to fix and prevents breakage for legacy
platforms, am restoring the string duplication with scumm_strdup().

Apart from this, we should look at the Fluidsynth v2.X releases
currently in RC testing as the API is now changed for this.
  • Loading branch information...
digitall committed Aug 20, 2018
1 parent 0e8f126 commit 93ed8a2c47055f4b737d79925bf0bca30adda24f
Showing with 14 additions and 3 deletions.
  1. +14 −3 audio/softsynth/fluidsynth.cpp
@@ -88,15 +88,26 @@ MidiDriver_FluidSynth::MidiDriver_FluidSynth(Audio::Mixer *mixer)

void MidiDriver_FluidSynth::setInt(const char *name, int val) {
fluid_settings_setint(_settings, name, val);
char *name2 = scumm_strdup(name);

fluid_settings_setint(_settings, name2, val);

void MidiDriver_FluidSynth::setNum(const char *name, double val) {
fluid_settings_setnum(_settings, name, val);
char *name2 = scumm_strdup(name);

fluid_settings_setnum(_settings, name2, val);

void MidiDriver_FluidSynth::setStr(const char *name, const char *val) {
fluid_settings_setstr(_settings, name, val);
char *name2 = scumm_strdup(name);
char *val2 = scumm_strdup(val);

fluid_settings_setstr(_settings, name2, val2);

int MidiDriver_FluidSynth::open() {

1 comment on commit 93ed8a2


This comment has been minimized.

Copy link

derselbst commented on 93ed8a2 Aug 22, 2018

...the relevant change was already introduced in fluidsynth 1.1.0, 9 years ago: FluidSynth/fluidsynth@b3fb606

Please sign in to comment.