Skip to content
Browse files

Merge a few compatibility ifdefs in for people who redefine their log…

…s to something else than NSLog() and for those using SenTestingKit.
  • Loading branch information...
1 parent f27c7fb commit 5afa0d797762aa694f92b0efa41ae7d48502ee95 @uliwitness committed Nov 8, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 UKHelperMacros.h
View
6 UKHelperMacros.h
@@ -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__
@@ -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];\

0 comments on commit 5afa0d7

Please sign in to comment.
Something went wrong with that request. Please try again.