// // Prefix header for all source files of the 'MasterPassword' target in the 'MasterPassword' project // #import #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8 #warning "This project uses features only available in Mac OS X 10.8 and later." #endif #import "Pearl-Prefix.pch" #ifdef __OBJC__ #import #import #import #ifdef CRASHLYTICS #import #endif #import "MPTypes.h" #import "MPMacConfig.h" #else #import #import #import #import #import #import #define trc(format, ...) \ do { \ char *_msg = NULL; \ asprintf( &_msg, format, ##__VA_ARGS__ ); \ void (*_sendMsg)(id, SEL, CFStringRef, NSInteger, CFStringRef, NSUInteger, CFStringRef) = (void *)objc_msgSend; \ _sendMsg( objc_msgSend( (id)objc_getClass( "PearlLogger" ), sel_getUid( "get" ) ), \ sel_getUid( "inFile:atLine:fromFunction:withLevel:text:" ), \ CFStringCreateWithCString( NULL, basename( (char *)__FILE__ ), kCFStringEncodingUTF8 ), __LINE__, \ CFStringCreateWithCString( NULL, __FUNCTION__, kCFStringEncodingUTF8 ), 0, \ CFStringCreateWithCString( NULL, _msg, kCFStringEncodingUTF8 ) ); \ } while (0) #define dbg(format, ...) \ do { \ char *_msg = NULL; \ asprintf( &_msg, format, ##__VA_ARGS__ ); \ void (*_sendMsg)(id, SEL, CFStringRef, NSInteger, CFStringRef, NSUInteger, CFStringRef) = (void *)objc_msgSend; \ _sendMsg( objc_msgSend( (id)objc_getClass( "PearlLogger" ), sel_getUid( "get" ) ), \ sel_getUid( "inFile:atLine:fromFunction:withLevel:text:" ), \ CFStringCreateWithCString( NULL, basename( (char *)__FILE__ ), kCFStringEncodingUTF8 ), __LINE__, \ CFStringCreateWithCString( NULL, __FUNCTION__, kCFStringEncodingUTF8 ), 1, \ CFStringCreateWithCString( NULL, _msg, kCFStringEncodingUTF8 ) ); \ } while (0) #define inf(format, ...) \ do { \ char *_msg = NULL; \ asprintf( &_msg, format, ##__VA_ARGS__ ); \ void (*_sendMsg)(id, SEL, CFStringRef, NSInteger, CFStringRef, NSUInteger, CFStringRef) = (void *)objc_msgSend; \ _sendMsg( objc_msgSend( (id)objc_getClass( "PearlLogger" ), sel_getUid( "get" ) ), \ sel_getUid( "inFile:atLine:fromFunction:withLevel:text:" ), \ CFStringCreateWithCString( NULL, basename( (char *)__FILE__ ), kCFStringEncodingUTF8 ), __LINE__, \ CFStringCreateWithCString( NULL, __FUNCTION__, kCFStringEncodingUTF8 ), 2, \ CFStringCreateWithCString( NULL, _msg, kCFStringEncodingUTF8 ) ); \ } while (0) #define wrn(format, ...) \ do { \ char *_msg = NULL; \ asprintf( &_msg, format, ##__VA_ARGS__ ); \ void (*_sendMsg)(id, SEL, CFStringRef, NSInteger, CFStringRef, NSUInteger, CFStringRef) = (void *)objc_msgSend; \ _sendMsg( objc_msgSend( (id)objc_getClass( "PearlLogger" ), sel_getUid( "get" ) ), \ sel_getUid( "inFile:atLine:fromFunction:withLevel:text:" ), \ CFStringCreateWithCString( NULL, basename( (char *)__FILE__ ), kCFStringEncodingUTF8 ), __LINE__, \ CFStringCreateWithCString( NULL, __FUNCTION__, kCFStringEncodingUTF8 ), 3, \ CFStringCreateWithCString( NULL, _msg, kCFStringEncodingUTF8 ) ); \ } while (0) #define err(format, ...) \ do { \ char *_msg = NULL; \ asprintf( &_msg, format, ##__VA_ARGS__ ); \ void (*_sendMsg)(id, SEL, CFStringRef, NSInteger, CFStringRef, NSUInteger, CFStringRef) = (void *)objc_msgSend; \ _sendMsg( objc_msgSend( (id)objc_getClass( "PearlLogger" ), sel_getUid( "get" ) ), \ sel_getUid( "inFile:atLine:fromFunction:withLevel:text:" ), \ CFStringCreateWithCString( NULL, basename( (char *)__FILE__ ), kCFStringEncodingUTF8 ), __LINE__, \ CFStringCreateWithCString( NULL, __FUNCTION__, kCFStringEncodingUTF8 ), 4, \ CFStringCreateWithCString( NULL, _msg, kCFStringEncodingUTF8 ) ); \ } while (0) #define ftl(format, ...) \ do { \ char *_msg = NULL; \ asprintf( &_msg, format, ##__VA_ARGS__ ); \ void (*_sendMsg)(id, SEL, CFStringRef, NSInteger, CFStringRef, NSUInteger, CFStringRef) = (void *)objc_msgSend; \ _sendMsg( objc_msgSend( (id)objc_getClass( "PearlLogger" ), sel_getUid( "get" ) ), \ sel_getUid( "inFile:atLine:fromFunction:withLevel:text:" ), \ CFStringCreateWithCString( NULL, basename( (char *)__FILE__ ), kCFStringEncodingUTF8 ), __LINE__, \ CFStringCreateWithCString( NULL, __FUNCTION__, kCFStringEncodingUTF8 ), 5, \ CFStringCreateWithCString( NULL, _msg, kCFStringEncodingUTF8 ) ); \ abort(); \ } while (0) #endif