2012-03-04 14:31:26 +00:00
|
|
|
//
|
|
|
|
// Prefix header for all source files of the 'MasterPassword' target in the 'MasterPassword' project
|
|
|
|
//
|
|
|
|
|
2015-09-23 04:31:33 +00:00
|
|
|
#import <Availability.h>
|
2014-12-31 16:28:46 +00:00
|
|
|
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8
|
2015-09-23 04:31:33 +00:00
|
|
|
#warning "This project uses features only available in Mac OS X 10.8 and later."
|
2014-12-31 16:28:46 +00:00
|
|
|
#endif
|
|
|
|
|
2012-10-31 02:54:34 +00:00
|
|
|
#import "Pearl-Prefix.pch"
|
2012-06-08 21:46:13 +00:00
|
|
|
|
2012-10-31 02:54:34 +00:00
|
|
|
#ifdef __OBJC__
|
2012-03-04 14:31:26 +00:00
|
|
|
|
2012-10-31 02:54:34 +00:00
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
#import <CoreData/CoreData.h>
|
2012-03-04 14:31:26 +00:00
|
|
|
|
2014-12-31 16:28:46 +00:00
|
|
|
#ifdef CRASHLYTICS
|
2015-09-23 04:31:33 +00:00
|
|
|
#import <Crashlytics/Crashlytics.h>
|
2014-12-31 16:28:46 +00:00
|
|
|
#endif
|
|
|
|
|
2012-03-04 14:31:26 +00:00
|
|
|
#import "MPTypes.h"
|
2012-10-31 02:54:34 +00:00
|
|
|
#import "MPMacConfig.h"
|
|
|
|
|
2015-09-23 04:31:33 +00:00
|
|
|
#else
|
|
|
|
|
|
|
|
#import <libgen.h>
|
|
|
|
#import <CoreFoundation/CFString.h>
|
|
|
|
#import <objc/runtime.h>
|
|
|
|
#import <objc/message.h>
|
2016-01-28 02:38:36 +00:00
|
|
|
#import <objc/NSObjCRuntime.h>
|
|
|
|
#import <stdlib.h>
|
2015-09-23 04:31:33 +00:00
|
|
|
|
2016-01-28 02:38:36 +00:00
|
|
|
#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)
|
2015-09-23 04:31:33 +00:00
|
|
|
|
2012-10-31 02:54:34 +00:00
|
|
|
#endif
|