Re: newie question
Re: newie question
- Subject: Re: newie question
- From: Bryan Henry <email@hidden>
- Date: Mon, 08 Dec 2008 20:35:07 -0500
Ah right. Just looked that up - I was wondering how to exclude the
comma if there aren't any variable arguments, so that debugLog(@"some
message") would still works.
http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/cpp/variadic-macros.html
if other people are looking for more info. ## has a special meaning
between a comma and a variable argument.
Thanks,
Bryan
On Dec 8, 2008, at 8:18 PM, Steve Checkoway wrote:
On Mon, Dec 08, 2008 at 09:21:07AM -0500, Bryan Henry wrote:
The macro, by the way, would be something like this:
// Debug-build logging macro
#ifdef DEBUG
#define debugLog(format, ...) NSLog(format, __VA_ARGS__)
#else
#define debugLog(format, ...) // Nothing
#endif
You probably want
#define debugLog(format, ...) NSLog((format), ## __VA_ARGS__)
--
Steve Checkoway
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
@mac.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden