Fix 64bit VSTs on Linux by fixing callback calling convention

This commit is contained in:
Lukas W
2018-01-14 23:03:10 +01:00
parent d454ef60e2
commit 20a6b96161
2 changed files with 11 additions and 8 deletions

View File

@@ -28,6 +28,9 @@
#include <stdint.h>
// Calling convention
#define VST_CALL_CONV __cdecl
#define CCONST(a, b, c, d)( ( ( (int32_t) a ) << 24 ) | \
( ( (int32_t) b ) << 16 ) | \
( ( (int32_t) c ) << 8 ) | \
@@ -205,13 +208,13 @@ public:
// 00-03
int32_t magic;
// dispatcher 04-07
intptr_t (* dispatcher)( AEffect * , int32_t , int32_t , intptr_t, void * , float );
intptr_t (VST_CALL_CONV * dispatcher)( AEffect * , int32_t , int32_t , intptr_t, void * , float );
// process, quite sure 08-0b
void (* process)( AEffect * , float * * , float * * , int32_t );
void (VST_CALL_CONV * process)( AEffect * , float * * , float * * , int32_t );
// setParameter 0c-0f
void (* setParameter)( AEffect * , int32_t , float );
void (VST_CALL_CONV * setParameter)( AEffect * , int32_t , float );
// getParameter 10-13
float (* getParameter)( AEffect * , int32_t );
float (VST_CALL_CONV * getParameter)( AEffect * , int32_t );
// programs 14-17
int32_t numPrograms;
// Params 18-1b
@@ -238,7 +241,7 @@ public:
// Don't know 4c-4f
char unknown1[4];
// processReplacing 50-53
void (* processReplacing)( AEffect * , float * * , float * * , int );
void (VST_CALL_CONV * processReplacing)( AEffect * , float * * , float * * , int );
} ;
@@ -281,7 +284,7 @@ public:
typedef intptr_t (* audioMasterCallback)( AEffect * , int32_t, int32_t, intptr_t, void * , float );
typedef intptr_t (VST_CALL_CONV * audioMasterCallback)( AEffect * , int32_t, int32_t, intptr_t, void * , float );
#endif

View File

@@ -331,7 +331,7 @@ private:
} ;
// callback used by plugin for being able to communicate with it's host
static intptr_t hostCallback( AEffect * _effect, int32_t _opcode,
static VST_CALL_CONV intptr_t hostCallback( AEffect * _effect, int32_t _opcode,
int32_t _index, intptr_t _value,
void * _ptr, float _opt );
@@ -819,7 +819,7 @@ bool RemoteVstPlugin::load( const std::string & _plugin_file )
return false;
}
typedef AEffect * ( __cdecl * mainEntryPointer )
typedef AEffect * ( VST_CALL_CONV * mainEntryPointer )
( audioMasterCallback );
mainEntryPointer mainEntry = (mainEntryPointer)
GetProcAddress( m_libInst, "VSTPluginMain" );