2
0

Fix error name collision.

This commit is contained in:
Maarten Billemont 2017-08-13 01:00:03 -04:00
parent 28c7a64bd2
commit d9cdb7ef83

View File

@ -39,21 +39,21 @@ __END_DECLS
#ifdef CRASHLYTICS #ifdef CRASHLYTICS
#define MPError(error_, message, ...) ({ \ #define MPError(error_, message, ...) ({ \
NSError *error = error_; \ NSError *__error = error_; \
err( message @"%@%@", ##__VA_ARGS__, error && [message length]? @"\n": @"", [error fullDescription]?: @"" ); \ err( message @"%@%@", ##__VA_ARGS__, __error && [message length]? @"\n": @"", [__error fullDescription]?: @"" ); \
\ \
if ([[MPConfig get].sendInfo boolValue]) { \ if ([[MPConfig get].sendInfo boolValue]) { \
[[Crashlytics sharedInstance] recordError:error withAdditionalUserInfo:@{ \ [[Crashlytics sharedInstance] recordError:__error withAdditionalUserInfo:@{ \
@"location": strf( @"%@:%d %@", @(basename((char *)__FILE__)), __LINE__, NSStringFromSelector(_cmd) ), \ @"location": strf( @"%@:%d %@", @(basename((char *)__FILE__)), __LINE__, NSStringFromSelector(_cmd) ), \
}]; \ }]; \
} \ } \
error; \ __error; \
}) })
#else #else
#define MPError(error_, message, ...) ({ \ #define MPError(error_, message, ...) ({ \
NSError *error = error_; \ NSError *__error = error_; \
err( message @"%@%@", ##__VA_ARGS__, error? @"\n": @"", [error fullDescription]?: @"" ); \ err( message @"%@%@", ##__VA_ARGS__, __error? @"\n": @"", [__error fullDescription]?: @"" ); \
error; \ __error; \
}) })
#endif #endif