mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-29 13:15:34 +08:00
Patched LCLNSLog.h to not generate build errors under ARC. refs #260
This commit is contained in:
19
Vendor/LibComponentLogging/NSLog/LCLNSLog.h
vendored
19
Vendor/LibComponentLogging/NSLog/LCLNSLog.h
vendored
@@ -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(); \
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user