RE: Clean way of generalizing CDECL

"Nick Trout" <[email protected]>
Newsgroups gmane.games.devel.general
Message-ID <911F8C8EB7A8084AAEDD55CEDC54D8F881FEA5@iggy.rockstarvancouver.com>

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of
> Brian Hook
> Sent: Tuesday, July 06, 2004 3:11 PM
> To: [email protected]
> Subject: [GD-General] Clean way of generalizing CDECL
> 
> I'd like to be able specify CDECL in a cross-platform manner.  On most
> x86 compilers there's just the __cdecl keywod:
> 
> void __cdecl foo( int x, int y, int z );
> 
> GCC, of course, does it completely differently:
> 
> void foo( int x, int y, int z ) __attribute((cdecl));
> 
> So a simple #define won't work.  Now, you can do a kind of convoluted
> thing using a define, but damn, it's REAL ugly.

Why not:

#define foo(T,N, ...) T __cdecl N ( __VA_ARGS__ )

foo (int, blah, int a, int b)  // declaration

or

#define foo2(T,N,A) T __cdecl N A 

foo2 (int, blah, (int a, int b))  // declaration


Nick



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Gamedevlists-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-general
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_idU7
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.