From e9e257e65624cac025e6012315d2265ef2c8e1d6 Mon Sep 17 00:00:00 2001 From: Anastasia Kubova Date: Thu, 3 Dec 2020 13:54:08 +0300 Subject: [PATCH] Resolve feedbacks --- Source/CrashReporter.h | 5 ++++- Source/PLCrashLogWriter.m | 5 +++++ Source/PLCrashReport.h | 6 +++++- Source/PLCrashReport.m | 5 +++-- Source/PLCrashReportBinaryImageInfo.h | 1 + Source/PLCrashReportBinaryImageInfo.m | 4 ++++ Source/PLCrashReportExceptionInfo.h | 1 - Source/PLCrashReportExceptionInfo.m | 4 ++++ Source/PLCrashReportMachineInfo.m | 4 ++++ Source/PLCrashReportStackFrameInfo.h | 1 + Source/PLCrashReportStackFrameInfo.m | 4 ++++ Source/PLCrashReportSystemInfo.m | 5 +++++ Source/PLCrashReportThreadInfo.h | 7 ++++--- Source/PLCrashReportThreadInfo.m | 4 ++++ Source/PLCrashReporter.h | 7 ++++++- Source/PLCrashReporter.m | 7 ++++++- Source/PLCrashReporterNSError.h | 9 ++++++++- 17 files changed, 68 insertions(+), 11 deletions(-) diff --git a/Source/CrashReporter.h b/Source/CrashReporter.h index 490170e..99878d3 100644 --- a/Source/CrashReporter.h +++ b/Source/CrashReporter.h @@ -32,10 +32,13 @@ #import #endif +#if __has_include() + // This must be included before any other PLCrashReporter includes, as // it redefines symbol names -#if __has_include() && __has_include() && __has_include() && __has_include() #import + +/* Library Imports */ #import #import #import diff --git a/Source/PLCrashLogWriter.m b/Source/PLCrashLogWriter.m index 9d4ad19..ed2aaf0 100644 --- a/Source/PLCrashLogWriter.m +++ b/Source/PLCrashLogWriter.m @@ -40,7 +40,12 @@ #import +#if __has_include() +#import +#else #import "PLCrashReport.h" +#endif + #import "PLCrashLogWriter.h" #import "PLCrashLogWriterEncoding.h" #import "PLCrashAsyncSignalInfo.h" diff --git a/Source/PLCrashReport.h b/Source/PLCrashReport.h index 5e3b926..f710c3f 100644 --- a/Source/PLCrashReport.h +++ b/Source/PLCrashReport.h @@ -28,8 +28,10 @@ #import -#if __has_include() && __has_include() && __has_include() && __has_include() && __has_include() && __has_include() && __has_include() && __has_include() && __has_include() && __has_include() && __has_include() && __has_include() && __has_include() +#ifndef PLCRASH_REPORT_H +#define PLCRASH_REPORT_H +#if __has_include() #import #import #import @@ -224,3 +226,5 @@ typedef struct _PLCrashReportDecoder _PLCrashReportDecoder; @property(nonatomic, readonly) CFUUIDRef uuidRef; @end + +#endif diff --git a/Source/PLCrashReport.m b/Source/PLCrashReport.m index 91ff9b5..f4cd3f7 100644 --- a/Source/PLCrashReport.m +++ b/Source/PLCrashReport.m @@ -26,13 +26,14 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -#if __has_include() && __has_include() +#if __has_include() #import #import #else -#import "PLCrashReporter.h" +#import "CrashReporter.h" #import "PLCrashReport.h" #endif + #import "PLCrashReport.pb-c.h" #import "PLCrashAsyncThread.h" diff --git a/Source/PLCrashReportBinaryImageInfo.h b/Source/PLCrashReportBinaryImageInfo.h index 5ff8c06..1a75051 100644 --- a/Source/PLCrashReportBinaryImageInfo.h +++ b/Source/PLCrashReportBinaryImageInfo.h @@ -27,6 +27,7 @@ */ #import + #if __has_include() #import #else diff --git a/Source/PLCrashReportBinaryImageInfo.m b/Source/PLCrashReportBinaryImageInfo.m index 0be57d9..6b46496 100644 --- a/Source/PLCrashReportBinaryImageInfo.m +++ b/Source/PLCrashReportBinaryImageInfo.m @@ -26,7 +26,11 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +#if __has_include() +#import +#else #import "PLCrashReportBinaryImageInfo.h" +#endif /** * Crash Log binary image info. Represents an executable or shared library. diff --git a/Source/PLCrashReportExceptionInfo.h b/Source/PLCrashReportExceptionInfo.h index 9ef99ab..7423ca9 100644 --- a/Source/PLCrashReportExceptionInfo.h +++ b/Source/PLCrashReportExceptionInfo.h @@ -34,7 +34,6 @@ #import "PLCrashReportThreadInfo.h" #endif - @interface PLCrashReportExceptionInfo : NSObject { @private /** Name */ diff --git a/Source/PLCrashReportExceptionInfo.m b/Source/PLCrashReportExceptionInfo.m index 917d838..3b872d8 100644 --- a/Source/PLCrashReportExceptionInfo.m +++ b/Source/PLCrashReportExceptionInfo.m @@ -26,7 +26,11 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +#if __has_include() +#import +#else #import "PLCrashReportExceptionInfo.h" +#endif /** * If a crash is triggered by an uncaught Objective-C exception, the exception name and reason will be made available. diff --git a/Source/PLCrashReportMachineInfo.m b/Source/PLCrashReportMachineInfo.m index cd16638..e13e333 100644 --- a/Source/PLCrashReportMachineInfo.m +++ b/Source/PLCrashReportMachineInfo.m @@ -26,7 +26,11 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +#if __has_include() +#import +#else #import "PLCrashReportMachineInfo.h" +#endif /** * Crash log host architecture information. diff --git a/Source/PLCrashReportStackFrameInfo.h b/Source/PLCrashReportStackFrameInfo.h index e4d033b..5fd4acc 100644 --- a/Source/PLCrashReportStackFrameInfo.h +++ b/Source/PLCrashReportStackFrameInfo.h @@ -27,6 +27,7 @@ */ #import + #if __has_include() #import #else diff --git a/Source/PLCrashReportStackFrameInfo.m b/Source/PLCrashReportStackFrameInfo.m index 543127f..60e9e9d 100644 --- a/Source/PLCrashReportStackFrameInfo.m +++ b/Source/PLCrashReportStackFrameInfo.m @@ -26,7 +26,11 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +#if __has_include() +#import +#else #import "PLCrashReportStackFrameInfo.h" +#endif /** * Crash log stack frame information. diff --git a/Source/PLCrashReportSystemInfo.m b/Source/PLCrashReportSystemInfo.m index 957c80a..18b5395 100644 --- a/Source/PLCrashReportSystemInfo.m +++ b/Source/PLCrashReportSystemInfo.m @@ -26,8 +26,13 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +#if __has_include() +#import +#import +#else #import "PLCrashReportSystemInfo.h" #import "PLCrashReportProcessorInfo.h" +#endif /** * @ingroup constants diff --git a/Source/PLCrashReportThreadInfo.h b/Source/PLCrashReportThreadInfo.h index 27c5481..b9092e2 100644 --- a/Source/PLCrashReportThreadInfo.h +++ b/Source/PLCrashReportThreadInfo.h @@ -28,10 +28,10 @@ #import -#ifndef PLCRASH_REPORT_THREAD_INFO -#define PLCRASH_REPORT_THREAD_INFO +#ifndef PLCRASH_REPORT_THREAD_INFO_H +#define PLCRASH_REPORT_THREAD_INFO_H -#if __has_include() && __has_include() +#if __has_include() #import #import #else @@ -84,4 +84,5 @@ @property(nonatomic, readonly, strong) NSArray *registers; @end + #endif diff --git a/Source/PLCrashReportThreadInfo.m b/Source/PLCrashReportThreadInfo.m index 01d3f95..1d45270 100644 --- a/Source/PLCrashReportThreadInfo.m +++ b/Source/PLCrashReportThreadInfo.m @@ -26,7 +26,11 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +#if __has_include() +#import +#else #import "PLCrashReportThreadInfo.h" +#endif /** * Crash log per-thread state information. diff --git a/Source/PLCrashReporter.h b/Source/PLCrashReporter.h index f3e4c6a..cfc6a54 100644 --- a/Source/PLCrashReporter.h +++ b/Source/PLCrashReporter.h @@ -29,7 +29,10 @@ #import #import -#if __has_include() && __has_include() +#ifndef PLCRASH_REPORTER_H +#define PLCRASH_REPORTER_H + +#if __has_include() #import #import #else @@ -142,3 +145,5 @@ typedef struct PLCrashReporterCallbacks { @property(nonatomic, strong) NSData *customData; @end + +#endif diff --git a/Source/PLCrashReporter.m b/Source/PLCrashReporter.m index 226de56..81f5b04 100644 --- a/Source/PLCrashReporter.m +++ b/Source/PLCrashReporter.m @@ -26,8 +26,13 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -#import "PLCrashReporter.h" +#if __has_include() +#import +#import +#else #import "CrashReporter.h" +#import "PLCrashReporter.h" +#endif #import "PLCrashFeatureConfig.h" diff --git a/Source/PLCrashReporterNSError.h b/Source/PLCrashReporterNSError.h index 937b434..56d85fd 100644 --- a/Source/PLCrashReporterNSError.h +++ b/Source/PLCrashReporterNSError.h @@ -27,9 +27,16 @@ */ #import -#import "CrashReporter.h" +#if __has_include() \ + && __has_include() +#import +#import +#else +#import "CrashReporter.h" #import "PLCrashMacros.h" +#endif + PLCR_EXPORT void plcrash_populate_error (NSError **error, PLCrashReporterError code, NSString *description, NSError *cause); PLCR_EXPORT void plcrash_populate_mach_error (NSError **error, kern_return_t kr, NSString *description);