Skip to content

Commit

Permalink
Merge a few compatibility ifdefs in for people who redefine their log…
Browse files Browse the repository at this point in the history
…s to something else than NSLog() and for those using SenTestingKit.
  • Loading branch information
uliwitness committed Nov 8, 2011
1 parent f27c7fb commit 5afa0d7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion UKHelperMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@
// This prefixes the method or function name to the message.
//

#ifndef UKLog
#if DEBUG
#define UKLog(args...) NSLog( @"%s: %@", __PRETTY_FUNCTION__, [NSString stringWithFormat: args])
#else
#define UKLog(args...) // stubbed out
#define UKLog(args...) while(0) // stubbed out
#endif
#endif // UKLog


#if __LP64__
Expand All @@ -66,11 +68,13 @@

#define CREATE_AUTORELEASE_POOL(pool) NSAutoreleasePool* (pool) = [[NSAutoreleasePool alloc] init]

#ifndef ASSIGN // SenTest declares its own macro
#define ASSIGN(targ,newval) do {\
NSObject* __UKHELPERMACRO_OLDTARG = (NSObject*)(targ);\
(targ) = [(newval) retain];\
[__UKHELPERMACRO_OLDTARG release];\
} while(0)
#endif // !defined(ASSIGN)
#define ASSIGNMUTABLECOPY(targ,newval) do {\
NSObject* __UKHELPERMACRO_OLDTARG = (NSObject*)(targ);\
(targ) = [(newval) mutableCopy];\
Expand Down

0 comments on commit 5afa0d7

Please sign in to comment.