forked from lksoft/MailCommon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MCCCommonHeader.h
38 lines (33 loc) · 1.11 KB
/
MCCCommonHeader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//
// MCCMailAbstractor.h
// MailCommonCode
//
// Created by Scott Little on 14/6/13.
// Copyright (c) 2013 Little Known Software. All rights reserved.
//
// This requires a few levels of rewriting to get the desired results.
#define _MCC_CONCAT_2(c,d) c ## d
#define _MCC_CONCAT(a,b) _MCC_CONCAT_2(a,b)
#ifdef MCC_PLUGIN_PREFIX
#define MCC_PREFIXED_NAME(symbol) _MCC_CONCAT(MCC_PLUGIN_PREFIX,symbol)
#define MCC_SUFFIXED_NAME(symbol) _MCC_CONCAT(symbol, _MCC_CONCAT(_, MCC_PLUGIN_PREFIX) )
#else
#define MCC_PREFIXED_NAME(symbol) _MCC_CONCAT(MCC,symbol)
#define MCC_SUFFIXED_NAME(symbol) _MCC_CONCAT(symbol,_MCC)
#endif // MCC_PLUGIN_PREFIX
#define _MCC_AS_STR(a) #a
#define _MCC_CONCAT_AS_STR(a, b) _MCC_AS_STR( a ## b )
#define _MCC_NS_STR(a) @a
#define MCC_NSSTRING(a, b) _MCC_NS_STR(_MCC_CONCAT_AS_STR(a, b))
// ARC compatibility
#if __has_feature(objc_arc)
#define RETAIN(x) (x)
#define RELEASE(x)
#define AUTORELEASE(x) (x)
#define DEALLOC(x) (x)
#else
#define RETAIN(x) ([(x) retain])
#define RELEASE(x) ([(x) release])
#define AUTORELEASE(x) ([(x) autorelease])
#define DEALLOC(x) ([(x) dealloc])
#endif