typedef int (*synthRenderFunc)(void* userdata, ...);
typedef void (*synthNoteOnFunc)(void* userdata, ...);
typedef void (*synthReleaseFunc)(void* userdata, ...);
typedef int (*synthSetParameterFunc)(void* userdata, ...);
typedef void (*synthDeallocFunc)(void* userdata);
void (*setGenerator)(PDSynth* synth, synthRenderFunc* render, synthNoteOnFunc* noteOn, synthReleaseFunc* release, synthSetParameterFunc* setparam, synthDeallocFunc* dealloc, void* userdata);
Notice that render
, etc. are declared as a pointer to their fn typedefs. But the typedef also defines a function pointer type.
So the function parameters are actually typed as pointers to function pointers. The correct signature should be:
void (*setGenerator)(PDSynth* synth, synthRenderFunc render, synthNoteOnFunc noteOn, synthReleaseFunc release, synthSetParameterFunc setparam, synthDeallocFunc dealloc, void* userdata);