What Gwynne said, but with one potential change, *some* versions of GCC require
a space before the last comma in order for it to be omitted if there are 0
variable args, as in:
#define GCLOGOC(format, ...) GCLogObjCMethod(self, _cmd, __LINE__,
NSStringFromClass([self class]), format , ## __VA_A
Ah, thanks guys! That works great :)
--Graham
On 02/11/2012, at 1:46 PM, Gwynne Raskind wrote:
> #if LOGGING
> #define GCLOGOC(format, ...) GCLogObjCMethod(self, _cmd, __LINE__,
> NSStringFromClass([self class]), format, ## __VA_ARGS__)
> #else
> #define GCLOGOC(format, ...)
> #endif
>
> --
On Nov 1, 2012, at 10:15 PM, Graham Cox wrote:
> Hi all, I'm having trouble figuring this out.
>
> I have a logging function thus:
>
> voidGCLogObjCMethod( id obj, SEL selector, NSUInteger lineNumber,
> NSString* tag, NSString* format, ... );
>
> I'd like to be able to wrap this usi
On Nov 1, 2012, at 7:15 PM, Graham Cox wrote:
> Hi all, I'm having trouble figuring this out.
>
> I have a logging function thus:
>
> voidGCLogObjCMethod( id obj, SEL selector, NSUInteger lineNumber,
> NSString* tag, NSString* format, ... );
>
> I'd like to be able to wrap this usi
Hi all, I'm having trouble figuring this out.
I have a logging function thus:
voidGCLogObjCMethod( id obj, SEL selector, NSUInteger lineNumber,
NSString* tag, NSString* format, ... );
I'd like to be able to wrap this using a macro that automatically supplies the
object, selector, l