From 422c76328b69fecb99c28884dd1d7d7a84c5ac37 Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Fri, 22 Mar 2019 21:15:03 +0100 Subject: [PATCH] fluid-fun: Define destructor signature based on fluidsynth version As per @carstene1ns 's suggestion. --- src/fluid-fun.cpp | 4 ---- src/fluid-fun.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/fluid-fun.cpp b/src/fluid-fun.cpp index d49157d..4bb2dbe 100644 --- a/src/fluid-fun.cpp +++ b/src/fluid-fun.cpp @@ -6,10 +6,6 @@ #include "debugwriter.h" -#ifdef SHARED_FLUID -#include -#endif - #if __LINUX__ || __ANDROID__ #define FLUID_LIB "libfluidsynth.so.1" #elif __MACOSX__ diff --git a/src/fluid-fun.h b/src/fluid-fun.h index 8521348..005bdf7 100644 --- a/src/fluid-fun.h +++ b/src/fluid-fun.h @@ -1,6 +1,12 @@ #ifndef FLUIDFUN_H #define FLUIDFUN_H +#ifdef SHARED_FLUID +# include +#else +# define FLUIDSYNTH_VERSION_MAJOR 2 +#endif + typedef struct _fluid_hashtable_t fluid_settings_t; typedef struct _fluid_synth_t fluid_synth_t; @@ -19,7 +25,12 @@ typedef int (*FLUIDSYNTHPROGRAMCHANGEPROC)(fluid_synth_t* synth, int chan, int p typedef fluid_settings_t* (*NEWFLUIDSETTINGSPROC)(void); typedef fluid_synth_t* (*NEWFLUIDSYNTHPROC)(fluid_settings_t* settings); typedef void (*DELETEFLUIDSETTINGSPROC)(fluid_settings_t* settings); + +#if FLUIDSYNTH_VERSION_MAJOR == 1 +typedef int (*DELETEFLUIDSYNTHPROC)(fluid_synth_t* synth); +#else typedef void (*DELETEFLUIDSYNTHPROC)(fluid_synth_t* synth); +#endif #define FLUID_FUNCS \ FLUID_FUN(settings_setnum, FLUIDSETTINGSSETNUMPROC) \