Permalink
Browse files

Patched LCLNSLog.h to not generate build errors under ARC. refs #260

  • Loading branch information...
1 parent d6e26a6 commit 2e04cb42ba742b665d37d83d0326603f64c6151e @blakewatters blakewatters committed Oct 16, 2011
Showing with 17 additions and 2 deletions.
  1. +17 −2 Vendor/LibComponentLogging/NSLog/LCLNSLog.h
@@ -50,16 +50,31 @@
// Integration with LibComponentLogging Core.
//
+#if __has_feature(objc_arc)
+#define LCLNSLogAutoReleasePoolBegin() \
+@autoreleasepool {
+#else
+#define LCLNSLogAutoReleasePoolBegin() \
+NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+#endif
+
+#if __has_feature(objc_arc)
+#define LCLNSLogAutoReleasePoolEnd() \
+}
+#else
+#define LCLNSLogAutoReleasePoolEnd() \
+[pool release];
+#endif
// Definition of _lcl_logger.
#define _lcl_logger(log_component, log_level, log_format, ...) { \
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; \
+ LCLNSLogAutoReleasePoolBegin(); \
NSLog(@"%s %s:%@:%d " log_format, \
_lcl_level_header_1[log_level], \
_lcl_component_header[log_component], \
[@__FILE__ lastPathComponent], \
__LINE__, \
## __VA_ARGS__); \
- [pool release]; \
+ LCLNSLogAutoReleasePoolEnd(); \
}

0 comments on commit 2e04cb4

Please sign in to comment.