Adjust darwin build configuration to new project structure.
This commit is contained in:
51
platform-darwin/Source/MasterPassword-Prefix.pch
Normal file
51
platform-darwin/Source/MasterPassword-Prefix.pch
Normal file
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// Prefix header for all source files of the 'MasterPassword' target in the 'MasterPassword' project
|
||||
//
|
||||
|
||||
#import <Availability.h>
|
||||
#import "Pearl-Prefix.pch"
|
||||
|
||||
#ifdef __OBJC__
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
//#import <Cocoa/Cocoa.h>
|
||||
#import <CoreData/CoreData.h>
|
||||
#ifdef CRASHLYTICS
|
||||
#import <Crashlytics/Crashlytics.h>
|
||||
#endif
|
||||
#import "MPTypes.h"
|
||||
#import "MPiOSConfig.h"
|
||||
//#import "MPMacConfig.h"
|
||||
|
||||
#else
|
||||
|
||||
#import <libgen.h>
|
||||
#import <CoreFoundation/CFString.h>
|
||||
#import <objc/runtime.h>
|
||||
#import <objc/message.h>
|
||||
#import <objc/NSObjCRuntime.h>
|
||||
#import <stdlib.h>
|
||||
|
||||
#define log(level, format, ...) \
|
||||
do { \
|
||||
void (*_sendMsg)(id, SEL, CFStringRef, NSInteger, CFStringRef, NSUInteger, CFStringRef) = (void *)objc_msgSend; \
|
||||
char *_msg = NULL; \
|
||||
asprintf( &_msg, format, ##__VA_ARGS__ ); \
|
||||
CFStringRef fileStr = CFStringCreateWithCString( NULL, basename( (char *)__FILE__ ), kCFStringEncodingUTF8 ); \
|
||||
CFStringRef funcStr = CFStringCreateWithCString( NULL, __FUNCTION__, kCFStringEncodingUTF8 ); \
|
||||
CFStringRef msgStr = CFStringCreateWithCString( NULL, _msg, kCFStringEncodingUTF8 ); \
|
||||
_sendMsg( objc_msgSend( (id)objc_getClass( "PearlLogger" ), sel_getUid( "get" ) ), \
|
||||
sel_getUid( "inFile:atLine:fromFunction:withLevel:text:" ), fileStr, __LINE__, funcStr, level, msgStr ); \
|
||||
CFRelease( fileStr ); \
|
||||
CFRelease( funcStr ); \
|
||||
CFRelease( msgStr ); \
|
||||
} while (0)
|
||||
|
||||
#define trc(format, ...) log( 0, format, ##__VA_ARGS__ );
|
||||
#define dbg(format, ...) log( 1, format, ##__VA_ARGS__ );
|
||||
#define inf(format, ...) log( 2, format, ##__VA_ARGS__ );
|
||||
#define wrn(format, ...) log( 3, format, ##__VA_ARGS__ );
|
||||
#define err(format, ...) log( 4, format, ##__VA_ARGS__ );
|
||||
#define ftl(format, ...) log( 5, format, ##__VA_ARGS__ );
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user