aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alMidi.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-11-28 04:21:39 -0800
committerChris Robinson <[email protected]>2013-11-28 04:21:39 -0800
commit5dad1688d4293b490a22b1c7459a20419e8cff5b (patch)
tree16a2a4a63e0edf456ff94f9bf3b3d1f0b53920e4 /OpenAL32/alMidi.c
parent98b0a3187e4bf190fa844aa620459f04556c980b (diff)
Fix building without FluidSynth
Diffstat (limited to 'OpenAL32/alMidi.c')
-rw-r--r--OpenAL32/alMidi.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/OpenAL32/alMidi.c b/OpenAL32/alMidi.c
index 27a02a62..cd1dd020 100644
--- a/OpenAL32/alMidi.c
+++ b/OpenAL32/alMidi.c
@@ -425,28 +425,30 @@ static void DSynth_Delete(DSynth *self)
MidiSynth *SynthCreate(ALCdevice *device)
{
- FSynth *fsynth;
- DSynth *dsynth;
-
- fsynth = calloc(1, sizeof(*fsynth));
- if(!fsynth)
- ERR("Failed to allocate FSynth\n");
- else
+#ifdef HAVE_FLUIDSYNTH
{
- FSynth_Construct(fsynth, device);
- if(FSynth_init(fsynth, device))
- return STATIC_CAST(MidiSynth, fsynth);
- DELETE_OBJ(STATIC_CAST(MidiSynth, fsynth));
- fsynth = NULL;
+ FSynth *synth = calloc(1, sizeof(*synth));
+ if(!synth)
+ ERR("Failed to allocate FSynth\n");
+ else
+ {
+ FSynth_Construct(synth, device);
+ if(FSynth_init(synth, device))
+ return STATIC_CAST(MidiSynth, synth);
+ DELETE_OBJ(STATIC_CAST(MidiSynth, synth));
+ }
}
+#endif
- dsynth = calloc(1, sizeof(*dsynth));
- if(!dsynth)
- ERR("Failed to allocate DSynth\n");
- else
{
- DSynth_Construct(dsynth, device);
- return STATIC_CAST(MidiSynth, dsynth);
+ DSynth *synth = calloc(1, sizeof(*synth));
+ if(!synth)
+ ERR("Failed to allocate DSynth\n");
+ else
+ {
+ DSynth_Construct(synth, device);
+ return STATIC_CAST(MidiSynth, synth);
+ }
}
return NULL;