mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Make sure the binaryImageSort for crash reports is static and doesn't cause link conflicts
This commit is contained in:
parent
dd9980f944
commit
17718e7d44
@ -35,8 +35,23 @@
|
|||||||
|
|
||||||
#import "BITCrashReportTextFormatter.h"
|
#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)
|
@interface BITCrashReportTextFormatter (PrivateAPI)
|
||||||
NSInteger binaryImageSort(id binary1, id binary2, void *context);
|
|
||||||
+ (NSString *)formatStackFrame:(PLCrashReportStackFrameInfo *)frameInfo
|
+ (NSString *)formatStackFrame:(PLCrashReportStackFrameInfo *)frameInfo
|
||||||
frameIndex:(NSUInteger)frameIndex
|
frameIndex:(NSUInteger)frameIndex
|
||||||
report:(PLCrashReport *)report;
|
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
|
@end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user