fluid-fun: Define destructor signature based on fluidsynth version

As per @carstene1ns 's suggestion.
This commit is contained in:
Jonas Kulla 2019-03-22 21:15:03 +01:00
parent d4b9adc1d1
commit 9dcfb66e86
2 changed files with 11 additions and 4 deletions

View File

@ -6,10 +6,6 @@
#include "debugwriter.h" #include "debugwriter.h"
#ifdef SHARED_FLUID
#include <fluidsynth.h>
#endif
#if __LINUX__ || __ANDROID__ #if __LINUX__ || __ANDROID__
#define FLUID_LIB "libfluidsynth.so.1" #define FLUID_LIB "libfluidsynth.so.1"
#elif __MACOSX__ #elif __MACOSX__

View File

@ -1,6 +1,12 @@
#ifndef FLUIDFUN_H #ifndef FLUIDFUN_H
#define FLUIDFUN_H #define FLUIDFUN_H
#ifdef SHARED_FLUID
# include <fluidsynth.h>
#else
# define FLUIDSYNTH_VERSION_MAJOR 2
#endif
typedef struct _fluid_hashtable_t fluid_settings_t; typedef struct _fluid_hashtable_t fluid_settings_t;
typedef struct _fluid_synth_t fluid_synth_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_settings_t* (*NEWFLUIDSETTINGSPROC)(void);
typedef fluid_synth_t* (*NEWFLUIDSYNTHPROC)(fluid_settings_t* settings); typedef fluid_synth_t* (*NEWFLUIDSYNTHPROC)(fluid_settings_t* settings);
typedef void (*DELETEFLUIDSETTINGSPROC)(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); typedef void (*DELETEFLUIDSYNTHPROC)(fluid_synth_t* synth);
#endif
#define FLUID_FUNCS \ #define FLUID_FUNCS \
FLUID_FUN(settings_setnum, FLUIDSETTINGSSETNUMPROC) \ FLUID_FUN(settings_setnum, FLUIDSETTINGSSETNUMPROC) \