[LAD] VST SDK2.4 issue

Pedro Lopez-Cabanillas pedro.lopez.cabanillas at gmail.com
Thu Aug 27 16:28:45 UTC 2009


On Thursday, August 27, 2009, Rui Nuno Capela wrote:
> On Thu, August 27, 2009 15:58, Victor Lazzarini wrote:
> > Hi everyone,
> >
> >
> > perhaps one of you might have already seen this issue and will know what
> > is the best solution.
> >
> > My problem is that one of the headers in the VST SDK2.4, aeffect.h,
> > has a macro, VSTCALLBACK, which in gcc will be defined as __cdecl . This
> > is not recognised by the compiler, thus preventing me from using that
> > header (to build a plugin).
> >
> >
> > My solution was to forcibly undefine __GNUC__ so that the macro
> > gets a blank definition.
> >
> > However, I am not sure this is the best way out; I am wondering whether
> > the calling convention will break the plugin, since the host might be
> > expecting __cdecl and it will not be getting it.
> >
> > Perhaps someone else would have a different solution.
>
> on my qtractor stuff, i do something like this,
>
>
> #if !defined(__WIN32__) && !defined(_WIN32) && !defined(WIN32)
> #define __cdecl
> #endif
>
> #include <aeffectx.h>
>
> #if !defined(VST_2_3_EXTENSIONS)
> #define VSTCALLBACK
> #endif
>
>
> it seems to get it just fine :)

I'd tried this:

#define __cdecl __attribute__((cdecl))

Much like another typical MSVC keyword:

#define __stdcall __attribute__((stdcall))

If you want to compare the documentation of both compilers:

http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
http://msdn.microsoft.com/en-us/library/984x0h58.aspx

Regards,
Pedro



More information about the Linux-audio-dev mailing list