Just to put this one to rest: I have built plugins by undefining __GNUC__ and thus not defining VSTCALLBACK as __cdecl and test them in JOST.
It works. However I can't say that it will always work on all hosts, so I guess the safest thing is to include Pedro's suggestion at the top of a plugin header file. Victor At 19:30 27/08/2009, victor wrote: >yes, sorry I meant exactly that, but got it all mangled. Your solution >fixes the macro and is the ideal one. Then there should be no problems >as far as the calling convention is concerned. Sorry if I didn't make myself >clear. > >Victor >----- Original Message ----- >From: "Pedro Lopez-Cabanillas" <[email protected]> >To: "victor" <[email protected]> >Cc: "Rui Nuno Capela" <[email protected]>; ><[email protected]> >Sent: Thursday, August 27, 2009 7:13 PM >Subject: Re: [LAD] VST SDK2.4 issue > > > > On Thursday, August 27, 2009, victor wrote: > >> But the silly thing I think is that the macro is defined for __GNUC__ > >> and it clearly does not work with it. If I undefine that token, it's > >> good. > >> > >> I don't like the idea of touch the sdk headers; I thought really they > >> should work out of the box. > >> > >> Rui's solution seems to be similar to mine (getting rid of __cdecl). > >> Whereas this one just fixes the macro to keep the calling convention as > >> it > >> is. > > > > The code posted by Rui is defining __cdecl as a void symbol, just before > > including the offending header. My proposal was defining __cdecl at the > > same > > place, but in a different way. Maybe this would be more clear: > > > > #if defined(__GNUC__) > > #define __cdecl __attribute__((cdecl)) > > #endif > > #include <aeffectx.h> > > > > [...] > > > >> > >> I have not been able to test the plugin yet, perhaps I'll have a better > >> idea of what I should do then. > >> > >> Victor > >> > >> ----- Original Message ----- > >> From: "Pedro Lopez-Cabanillas" <[email protected]> > >> To: "Rui Nuno Capela" <[email protected]> > >> Cc: "Victor Lazzarini" <[email protected]>; > >> <[email protected]> > >> Sent: Thursday, August 27, 2009 5:28 PM > >> Subject: Re: [LAD] VST SDK2.4 issue > >> > >> > 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 > > > > > >_______________________________________________ >Linux-audio-dev mailing list >[email protected] >http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev Victor Lazzarini Music Technology Laboratory Music Department National University of Ireland, Maynooth _______________________________________________ Linux-audio-dev mailing list [email protected] http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
