Re: variadic variable argument list in #define
Re: variadic variable argument list in #define
- Subject: Re: variadic variable argument list in #define
- From: Clark Cox <email@hidden>
- Date: Tue, 10 Feb 2004 19:41:42 -0500
On 2004/02/10, at 12:48, Ben Dougall wrote:
>
On Tuesday, February 10, 2004, at 04:44 pm, Marten van Gelderen wrote:
>
>
> Hello Ben,
>
>
>
> Try (right from the Cocoa docs):
>
>
>
> #define myDebug(format, args...) fprintf(stderr, format, args)
>
>
Martin, yup you're right. now works fine. in my case it was:
>
>
#define f(args...) function(args,NULL)
>
>
but the main thing was 'args...' and 'args', not '...' and
>
'__VA_ARGS__'.
Just in case you missed it before, the 'args...'/'args' notation is a
GCC-specific extension. Which, of course isn't a problem if your code
will only ever be compiled with GCC, just an FYI. The "correct" way to
do it is demonstrated by the link that Bill Bumgarner posted (
http://www.pycs.net/bbum/2003/12/11.html ).
--
Clark S. Cox III
email@hidden
http://homepage.mac.com/clarkcox3/
http://homepage.mac.com/clarkcox3/blog/B1196589870/index.html
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.