2
0

Mac build fixes and Fabric integration.

This commit is contained in:
Maarten Billemont 2016-01-27 21:38:36 -05:00
parent 39b380b938
commit 0aa47cc3f4
12 changed files with 131 additions and 60 deletions

Binary file not shown.

View File

@ -2,7 +2,19 @@
// FABAttributes.h
// Fabric
//
// Copyright (c) 2015 Twitter. All rights reserved.
// Copyright (C) 2015 Twitter, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#pragma once

View File

@ -1,7 +1,20 @@
//
// Fabric.h
// Fabric
//
// Copyright (c) 2015 Twitter. All rights reserved.
// Copyright (C) 2015 Twitter, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#import <Foundation/Foundation.h>

View File

@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>14E46</string>
<string>14F1021</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.5.5</string>
<string>1.6.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
@ -25,11 +25,11 @@
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>30</string>
<string>45</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>7A220</string>
<string>7B91b</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
@ -37,9 +37,9 @@
<key>DTSDKName</key>
<string>macosx10.11</string>
<key>DTXcode</key>
<string>0700</string>
<string>0710</string>
<key>DTXcodeBuild</key>
<string>7A220</string>
<string>7B91b</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2015 Twitter. All rights reserved.</string>
<key>UIDeviceFamily</key>

View File

@ -11,8 +11,8 @@ DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
DIR="\"${DIR}"
PATH_SEP="/"
VALIDATE_COMMAND="uploadDSYM\" $@ validate"
UPLOAD_COMMAND="uploadDSYM\" $@"
VALIDATE_COMMAND="uploadDSYM\" $@ validate run-script"
UPLOAD_COMMAND="uploadDSYM\" $@ run-script"
# Ensure params are as expected, run in sync mode to validate
eval $DIR$PATH_SEP$VALIDATE_COMMAND

Binary file not shown.

View File

@ -11,8 +11,8 @@
//// Logging.
int mpw_verbosity;
#ifndef trc
int mpw_verbosity;
#define trc_level 3
#define trc(...) \
if (mpw_verbosity >= 3) \

View File

@ -20,6 +20,7 @@
static NSDictionary *createKeyQuery(MPUserEntity *user, BOOL newItem, MPKeyOrigin *keyOrigin) {
#if TARGET_OS_IPHONE
if (user.touchID && kSecUseOperationPrompt) {
if (keyOrigin)
*keyOrigin = MPKeyOriginKeyChainBiometric;
@ -42,6 +43,7 @@ static NSDictionary *createKeyQuery(MPUserEntity *user, BOOL newItem, MPKeyOrigi
}
matches:nil];
}
#endif
if (keyOrigin)
*keyOrigin = MPKeyOriginKeyChain;

View File

@ -16,7 +16,7 @@
return self;
[self.defaults registerDefaults:@{
NSStringFromSelector( @selector(iTunesID) ) : @"510296984",
NSStringFromSelector( @selector(appleID) ) : @"510296984",
}];
return self;

View File

@ -37,8 +37,6 @@
DA2CA4F018D323D3007798F8 /* NSArray+Pearl.h in Headers */ = {isa = PBXBuildFile; fileRef = DA2CA4EA18D323D3007798F8 /* NSArray+Pearl.h */; };
DA2CA4F118D323D3007798F8 /* NSTimer+PearlBlock.m in Sources */ = {isa = PBXBuildFile; fileRef = DA2CA4EB18D323D3007798F8 /* NSTimer+PearlBlock.m */; };
DA2CA4F218D323D3007798F8 /* NSTimer+PearlBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = DA2CA4EC18D323D3007798F8 /* NSTimer+PearlBlock.h */; };
DA30E9CE15722ECA00A68B4C /* NSBundle+PearlMutableInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = DA30E9CB15722ECA00A68B4C /* NSBundle+PearlMutableInfo.h */; };
DA30E9CF15722ECA00A68B4C /* NSBundle+PearlMutableInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = DA30E9CC15722ECA00A68B4C /* NSBundle+PearlMutableInfo.m */; };
DA30E9D015722ECA00A68B4C /* Pearl.m in Sources */ = {isa = PBXBuildFile; fileRef = DA30E9CD15722ECA00A68B4C /* Pearl.m */; };
DA30E9D215722EE500A68B4C /* Pearl-Crypto.m in Sources */ = {isa = PBXBuildFile; fileRef = DA30E9D115722EE500A68B4C /* Pearl-Crypto.m */; };
DA30E9D715723E6900A68B4C /* PearlLazy.h in Headers */ = {isa = PBXBuildFile; fileRef = DA30E9D515723E6900A68B4C /* PearlLazy.h */; };
@ -158,6 +156,7 @@
DACA29741705E1A8002C6C22 /* dictionary.lst in Resources */ = {isa = PBXBuildFile; fileRef = DACA29721705E1A8002C6C22 /* dictionary.lst */; };
DACA298D1705E2BD002C6C22 /* JRSwizzle.h in Headers */ = {isa = PBXBuildFile; fileRef = DACA29771705E2BD002C6C22 /* JRSwizzle.h */; };
DACA299A1705E2BD002C6C22 /* JRSwizzle.m in Sources */ = {isa = PBXBuildFile; fileRef = DACA298C1705E2BD002C6C22 /* JRSwizzle.m */; };
DACBFCDF1C59B22E007EF90F /* NSMutableSet+Pearl.m in Sources */ = {isa = PBXBuildFile; fileRef = DACBFCDC1C59B22E007EF90F /* NSMutableSet+Pearl.m */; };
DAD9B5F01762CAA4001835F9 /* ServiceManagement.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DAD9B5EF1762CAA4001835F9 /* ServiceManagement.framework */; };
DAD9B5F11762CAB9001835F9 /* MasterPassword-Mac-LoginHelper.app in Copy LoginHelper */ = {isa = PBXBuildFile; fileRef = DAD9B5E6176299BA001835F9 /* MasterPassword-Mac-LoginHelper.app */; };
DAEB942E18B47FB3000490CC /* MPInitialWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = DA0933C91747A56A00DE1CEF /* MPInitialWindow.xib */; };
@ -303,8 +302,6 @@
DA2CA4EA18D323D3007798F8 /* NSArray+Pearl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+Pearl.h"; sourceTree = "<group>"; };
DA2CA4EB18D323D3007798F8 /* NSTimer+PearlBlock.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSTimer+PearlBlock.m"; sourceTree = "<group>"; };
DA2CA4EC18D323D3007798F8 /* NSTimer+PearlBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSTimer+PearlBlock.h"; sourceTree = "<group>"; };
DA30E9CB15722ECA00A68B4C /* NSBundle+PearlMutableInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSBundle+PearlMutableInfo.h"; sourceTree = "<group>"; };
DA30E9CC15722ECA00A68B4C /* NSBundle+PearlMutableInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBundle+PearlMutableInfo.m"; sourceTree = "<group>"; };
DA30E9CD15722ECA00A68B4C /* Pearl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Pearl.m; sourceTree = "<group>"; };
DA30E9D115722EE500A68B4C /* Pearl-Crypto.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Pearl-Crypto.m"; sourceTree = "<group>"; };
DA30E9D515723E6900A68B4C /* PearlLazy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PearlLazy.h; sourceTree = "<group>"; };
@ -868,6 +865,8 @@
DACA29721705E1A8002C6C22 /* dictionary.lst */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = dictionary.lst; sourceTree = "<group>"; };
DACA29771705E2BD002C6C22 /* JRSwizzle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRSwizzle.h; sourceTree = "<group>"; };
DACA298C1705E2BD002C6C22 /* JRSwizzle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JRSwizzle.m; sourceTree = "<group>"; };
DACBFCDB1C59B22E007EF90F /* NSMutableSet+Pearl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableSet+Pearl.h"; sourceTree = "<group>"; };
DACBFCDC1C59B22E007EF90F /* NSMutableSet+Pearl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableSet+Pearl.m"; sourceTree = "<group>"; };
DAD0C5F619FD6034009CB08D /* icon_128x128.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon_128x128.png; sourceTree = "<group>"; };
DAD0C5F719FD6034009CB08D /* icon_128x128@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_128x128@2x.png"; sourceTree = "<group>"; };
DAD0C5F819FD6034009CB08D /* icon_16x16.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon_16x16.png; sourceTree = "<group>"; };
@ -1060,9 +1059,9 @@
DA5E5C7917248AA1003798D8 /* lib */ = {
isa = PBXGroup;
children = (
DA5E5C8717248AA1003798D8 /* libscryptenc-osx.a */,
DAE8E65319867ADA00416A0F /* libopensslcrypto-osx.a */,
DAEB938518AB0FFD000490CC /* include */,
DAE8E65319867ADA00416A0F /* libopensslcrypto-osx.a */,
DA5E5C8717248AA1003798D8 /* libscryptenc-osx.a */,
);
path = lib;
sourceTree = "<group>";
@ -1799,8 +1798,6 @@
93D39067C0AFDC581794E2B8 /* NSArray+Indexing.m */,
DA2CA4EA18D323D3007798F8 /* NSArray+Pearl.h */,
DA2CA4E918D323D3007798F8 /* NSArray+Pearl.m */,
DA30E9CB15722ECA00A68B4C /* NSBundle+PearlMutableInfo.h */,
DA30E9CC15722ECA00A68B4C /* NSBundle+PearlMutableInfo.m */,
DAFE4A63150399FF003ABA93 /* NSDateFormatter+RFC3339.h */,
DAFE4A63150399FF003ABA91 /* NSDateFormatter+RFC3339.m */,
93D393B97158D7BE9332EA53 /* NSDictionary+Indexing.h */,
@ -1809,6 +1806,8 @@
DA2CA4E718D323D3007798F8 /* NSError+PearlFullDescription.m */,
DA3B8451190FC86F00246EEA /* NSManagedObject+Pearl.h */,
DA3B8450190FC86F00246EEA /* NSManagedObject+Pearl.m */,
DACBFCDB1C59B22E007EF90F /* NSMutableSet+Pearl.h */,
DACBFCDC1C59B22E007EF90F /* NSMutableSet+Pearl.m */,
DAADCC3E19FAFFAD00987B1D /* NSNotificationCenter+PearlEasyCleanup.h */,
DAFE45D815039823003ABA7C /* NSObject+PearlExport.h */,
DAFE45D915039823003ABA7C /* NSObject+PearlExport.m */,
@ -1929,7 +1928,6 @@
DAFE4A3615039824003ABA7C /* PearlKeyChain.h in Headers */,
DAFE4A3815039824003ABA7C /* PearlRSAKey.h in Headers */,
DAFE4A3A15039824003ABA7C /* PearlSCrypt.h in Headers */,
DA30E9CE15722ECA00A68B4C /* NSBundle+PearlMutableInfo.h in Headers */,
DA30E9D715723E6900A68B4C /* PearlLazy.h in Headers */,
DAADCC4719FAFFAD00987B1D /* NSNotificationCenter+PearlEasyCleanup.h in Headers */,
DAFE4A63150399FF003ABA88 /* NSObject+PearlKVO.h in Headers */,
@ -2045,6 +2043,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = MP;
LastSwiftUpdateCheck = 0720;
LastTestingUpgradeCheck = 0510;
LastUpgradeCheck = 0710;
ORGANIZATIONNAME = Lyndir;
@ -2222,7 +2221,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = "/bin/sh -e";
shellScript = "../../../External/Mac/Crashlytics.framework/run \\\n \"$(/usr/libexec/PlistBuddy -c \"Print :'API Key'\" ../../Resources/Crashlytics/Crashlytics.plist)\" 410fb41450e3a2e50fa8357682d812ecd3e1846f2141a99bdb9d3a6a981ad69c";
shellScript = "../../../External/Mac/Fabric.framework/run \\\n \"$(/usr/libexec/PlistBuddy -c \"Print :'API Key'\" ../../Resources/Crashlytics/Crashlytics.plist)\" 410fb41450e3a2e50fa8357682d812ecd3e1846f2141a99bdb9d3a6a981ad69c";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
@ -2237,6 +2236,7 @@
DA32CFE519CF1C71004F3F0E /* MPUserEntity.m in Sources */,
DA5E5CF71724A667003798D8 /* MPAlgorithmV0.m in Sources */,
DA5E5CF81724A667003798D8 /* MPAlgorithmV1.m in Sources */,
DACBFCDF1C59B22E007EF90F /* NSMutableSet+Pearl.m in Sources */,
DA6774311A4746AF004F356A /* mpw-util.c in Sources */,
DA5E5CF91724A667003798D8 /* MPAppDelegate_Key.m in Sources */,
DA5180CE19FF307E00A587E9 /* MPAppDelegate_Store.m in Sources */,
@ -2320,7 +2320,6 @@
DAFE4A3915039824003ABA7C /* PearlRSAKey.m in Sources */,
DAFE4A3B15039824003ABA7C /* PearlSCrypt.m in Sources */,
DA8ED895192906920099B726 /* PearlTween.m in Sources */,
DA30E9CF15722ECA00A68B4C /* NSBundle+PearlMutableInfo.m in Sources */,
DA2CA4F118D323D3007798F8 /* NSTimer+PearlBlock.m in Sources */,
DA3B8452190FC86F00246EEA /* NSManagedObject+Pearl.m in Sources */,
DA30E9D015722ECA00A68B4C /* Pearl.m in Sources */,
@ -2563,6 +2562,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_ENTITLEMENTS = MasterPassword.entitlements;
CODE_SIGN_IDENTITY = "Mac Developer";
@ -2573,6 +2573,7 @@
);
GCC_PREFIX_HEADER = "MasterPassword-Prefix.pch";
INFOPLIST_FILE = "MasterPassword-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"/Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/Pearl/Pearl-Crypto/lib",
@ -2580,6 +2581,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.lyndir.lhunath.MasterPassword.Mac;
PROVISIONING_PROFILE = "";
SKIP_INSTALL = NO;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
WRAPPER_NAME = "Master Password.${WRAPPER_EXTENSION}";
};
name = "Debug-Mac";
@ -2588,6 +2590,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_ENTITLEMENTS = MasterPassword.entitlements;
CODE_SIGN_IDENTITY = "Developer ID Application";
@ -2598,6 +2601,7 @@
);
GCC_PREFIX_HEADER = "MasterPassword-Prefix.pch";
INFOPLIST_FILE = "MasterPassword-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"/Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/Pearl/Pearl-Crypto/lib",
@ -2740,6 +2744,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_ENTITLEMENTS = MasterPassword.entitlements;
CODE_SIGN_IDENTITY = "3rd Party Mac Developer Application";
@ -2750,6 +2755,7 @@
);
GCC_PREFIX_HEADER = "MasterPassword-Prefix.pch";
INFOPLIST_FILE = "MasterPassword-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"/Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/Pearl/Pearl-Crypto/lib",

View File

@ -28,42 +28,80 @@
#import <CoreFoundation/CFString.h>
#import <objc/runtime.h>
#import <objc/message.h>
#import <objc/NSObjCRuntime.h>
#import <stdlib.h>
#define trc(format, ...) objc_msgSend( \
objc_msgSend( (id)objc_getClass("PearlLogger"), sel_getUid( "get" ) ), \
sel_getUid( "inFile:atLine:trc:" ), \
basename( (char *)__FILE__ ), __LINE__, \
CFStringCreateWithCString( NULL, format, kCFStringEncodingUTF8 ), \
##__VA_ARGS__)
#define dbg(format, ...) objc_msgSend( \
objc_msgSend( (id)objc_getClass("PearlLogger"), sel_getUid( "get" ) ), \
sel_getUid( "inFile:atLine:dbg:" ), \
basename( (char *)__FILE__ ), __LINE__, \
CFStringCreateWithCString( NULL, format, kCFStringEncodingUTF8 ), \
##__VA_ARGS__)
#define inf(format, ...) objc_msgSend( \
objc_msgSend( (id)objc_getClass("PearlLogger"), sel_getUid( "get" ) ), \
sel_getUid( "inFile:atLine:inf:" ), \
basename( (char *)__FILE__ ), __LINE__, \
CFStringCreateWithCString( NULL, format, kCFStringEncodingUTF8 ), \
##__VA_ARGS__)
#define wrn(format, ...) objc_msgSend( \
objc_msgSend( (id)objc_getClass("PearlLogger"), sel_getUid( "get" ) ), \
sel_getUid( "inFile:atLine:wrn:" ), \
basename( (char *)__FILE__ ), __LINE__, \
CFStringCreateWithCString( NULL, format, kCFStringEncodingUTF8 ), \
##__VA_ARGS__)
#define err(format, ...) objc_msgSend( \
objc_msgSend( (id)objc_getClass("PearlLogger"), sel_getUid( "get" ) ), \
sel_getUid( "inFile:atLine:err:" ), \
basename( (char *)__FILE__ ), __LINE__, \
CFStringCreateWithCString( NULL, format, kCFStringEncodingUTF8 ), \
##__VA_ARGS__)
#define ftl(format, ...) do{objc_msgSend( \
objc_msgSend( (id)objc_getClass("PearlLogger"), sel_getUid( "get" ) ), \
sel_getUid( "inFile:atLine:ftl:" ), \
basename( (char *)__FILE__ ), __LINE__, \
CFStringCreateWithCString( NULL, format, kCFStringEncodingUTF8 ), \
##__VA_ARGS__); abort(); } while (0)
#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