Re: [GD-General] Clean way of generalizing CDECL
Brought to you by:
vexxed72
From: Brian H. <ho...@bo...> - 2004-07-08 18:07:55
|
> Most likely because you want to share many interfaces (header > files) across platforms, therefore you want declarations to include > "some" calling convention. Exactly. And it's necessary to specify calling conventions so that your library compiled with one convention is compatible with someone else's application that may have been built with __fastcall. PoshLib (www.poshlib.org) tries to solve most of these problems cleanly and portably, which is why I'm asking about this. I'm glad to find out that __attribute__((cdecl)) seems to be prefix or suffix friendly. With POSH you do: void POSH_CDECL foo( int x ); or, if you ant DLL export to work magically as well: POSH_PUBLIC_API( void ) POSH_CDECL foo( int x ); Brian |