2017-02-10 19:20:11 +01:00
|
|
|
//
|
2018-01-10 16:54:17 +01:00
|
|
|
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
2017-02-10 19:20:11 +01:00
|
|
|
//
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
2015-12-07 03:31:43 +01:00
|
|
|
|
2017-12-02 00:51:13 +01:00
|
|
|
@import CocoaLumberjack;
|
2017-08-18 23:13:51 +02:00
|
|
|
|
2015-12-07 03:31:43 +01:00
|
|
|
#ifdef DEBUG
|
2017-12-02 00:51:13 +01:00
|
|
|
static const NSUInteger ddLogLevel = DDLogLevelAll;
|
2015-12-07 03:31:43 +01:00
|
|
|
#else
|
2017-12-02 00:51:13 +01:00
|
|
|
static const NSUInteger ddLogLevel = DDLogLevelInfo;
|
2015-12-07 03:31:43 +01:00
|
|
|
#endif
|
2017-11-30 02:18:58 +01:00
|
|
|
#import "Constraints.h"
|
|
|
|
#import "NSObject+OWS.h"
|
|
|
|
#import "OWSAnalytics.h"
|
2018-01-10 16:54:17 +01:00
|
|
|
#import "OWSAsserts.h"
|
2017-11-30 02:18:58 +01:00
|
|
|
#import "OWSDispatch.h"
|
|
|
|
#import "iOSVersions.h"
|
|
|
|
|
2015-12-07 03:31:43 +01:00
|
|
|
#define BLOCK_SAFE_RUN(block, ...) \
|
|
|
|
block ? dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), \
|
|
|
|
^{ \
|
|
|
|
block(__VA_ARGS__); \
|
|
|
|
}) \
|
|
|
|
: nil
|
|
|
|
#define SYNC_BLOCK_SAFE_RUN(block, ...) block ? block(__VA_ARGS__) : nil
|
|
|
|
|
|
|
|
#define MacrosSingletonImplemention \
|
|
|
|
+(instancetype)sharedInstance { \
|
|
|
|
static dispatch_once_t onceToken; \
|
|
|
|
static id sharedInstance = nil; \
|
|
|
|
dispatch_once(&onceToken, ^{ \
|
|
|
|
sharedInstance = [self.class new]; \
|
|
|
|
}); \
|
|
|
|
\
|
|
|
|
return sharedInstance; \
|
|
|
|
}
|
|
|
|
|
2017-01-04 21:14:53 +01:00
|
|
|
#define MacrosSingletonInterface +(instancetype)sharedInstance;
|