session-ios/SignalServiceKit/src/TSPrefix.h

41 lines
1.4 KiB
C
Raw Normal View History

2017-02-10 19:20:11 +01:00
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
2017-01-04 21:14:53 +01:00
#import "Asserts.h"
2017-02-10 19:20:11 +01:00
#import "Constraints.h"
2017-11-08 19:03:51 +01:00
#import "NSObject+OWS.h"
2017-02-10 19:20:11 +01:00
#import "OWSAnalytics.h"
#import "OWSDispatch.h"
2017-11-08 19:03:51 +01:00
#import "iOSVersions.h"
2017-02-10 19:20:11 +01:00
#import <Foundation/Foundation.h>
2015-12-07 03:31:43 +01:00
@import CocoaLumberjack;
2015-12-07 03:31:43 +01:00
#ifdef DEBUG
static const NSUInteger ddLogLevel = DDLogLevelAll;
#else
static const NSUInteger ddLogLevel = DDLogLevelInfo;
2015-12-07 03:31:43 +01:00
#endif
#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;