forked from theos/theos
-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathPrefix.pch
65 lines (56 loc) · 1.92 KB
/
Prefix.pch
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef __has_feature
#define __has_feature(feature) (0)
#endif
#ifndef __has_extension
#define __has_extension(extension) (0)
#endif
#ifdef __OBJC__
#define CLASS(cls) objc_getClass(#cls)
#ifdef DEBUG
#define __DEBUG__
#endif
#ifndef __clang__
#define weak assign
#define strong retain
#define instancetype id
#define nullable
#endif
#import <Foundation/Foundation.h>
#ifndef __clang__
// Fix old GCC versions not identifying the correct response type on [[NSDictionary alloc] initWithContentsOfFile:...] and other similar calls
#define THEOS_WORKAROUND_ALLOC(type) @interface type() + (type *)alloc; @end
THEOS_WORKAROUND_ALLOC(NSDictionary);
THEOS_WORKAROUND_ALLOC(NSMutableDictionary);
THEOS_WORKAROUND_ALLOC(NSArray);
THEOS_WORKAROUND_ALLOC(NSMutableArray);
#undef THEOS_WORKAROUND_ALLOC
// Workaround NS_AVAILABLE being used in enums, by disabling entirely :(
#undef NS_AVAILABLE
#define NS_AVAILABLE(osx, ios)
#endif
#ifdef __DEBUG__
#define CMLog(format, ...) NSLog(@"(%s) in [%s:%d] ::: %@", __PRETTY_FUNCTION__, __FILE__, __LINE__, [NSString stringWithFormat:format, ## __VA_ARGS__])
#define MARK CMLog(@"%s", __PRETTY_FUNCTION__);
#define START_TIMER NSTimeInterval start = [NSDate timeIntervalSinceReferenceDate];
#define END_TIMER(msg) NSTimeInterval stop = [NSDate timeIntervalSinceReferenceDate]; CMLog([NSString stringWithFormat:@"%@ Time = %f", msg, stop-start])
#else
#define CMLog(format, ...)
#define MARK
#define START_TIMER
#define END_TIMER(msg)
//#define NSLog(...)
#endif
#define NB [NSBundle mainBundle]
#define UD [NSUserDefaults standardUserDefaults]
#define FM [NSFileManager defaultManager]
#endif
#ifndef __clang__
#if defined(TARGET_MACOSX) || defined(TARGET_IPHONEOS)
#import <Availability.h>
#undef NS_AVAILABLE
#define NS_AVAILABLE(osx, ios)
#undef __OSX_AVAILABLE_STARTING
#define __OSX_AVAILABLE_STARTING(osx, ios)
#include <stdbool.h>
#endif
#endif