Make sure the binaryImageSort for crash reports is static and doesn't cause link conflicts

This commit is contained in:
Andreas Linde 2012-08-08 20:16:45 +02:00
parent dd9980f944
commit 17718e7d44

View File

@ -35,8 +35,23 @@
#import "BITCrashReportTextFormatter.h"
/**
* Sort PLCrashReportBinaryImageInfo instances by their starting address.
*/
static NSInteger binaryImageSort(id binary1, id binary2, void *context) {
uint64_t addr1 = [binary1 imageBaseAddress];
uint64_t addr2 = [binary2 imageBaseAddress];
if (addr1 < addr2)
return NSOrderedAscending;
else if (addr1 > addr2)
return NSOrderedDescending;
else
return NSOrderedSame;
}
@interface BITCrashReportTextFormatter (PrivateAPI)
NSInteger binaryImageSort(id binary1, id binary2, void *context);
+ (NSString *)formatStackFrame:(PLCrashReportStackFrameInfo *)frameInfo
frameIndex:(NSUInteger)frameIndex
report:(PLCrashReport *)report;
@ -586,19 +601,4 @@ NSInteger binaryImageSort(id binary1, id binary2, void *context);
}
}
/**
* Sort PLCrashReportBinaryImageInfo instances by their starting address.
*/
NSInteger binaryImageSort(id binary1, id binary2, void *context) {
uint64_t addr1 = [binary1 imageBaseAddress];
uint64_t addr2 = [binary2 imageBaseAddress];
if (addr1 < addr2)
return NSOrderedAscending;
else if (addr1 > addr2)
return NSOrderedDescending;
else
return NSOrderedSame;
}
@end