Updated dispatch_ macro in order to avoid redefinition when included as Pod
This commit is contained in:
parent
e41af47e2f
commit
8826031a91
|
@ -57,16 +57,20 @@ typedef void(^SDWebImageNoParamsBlock)();
|
|||
|
||||
extern NSString *const SDWebImageErrorDomain;
|
||||
|
||||
#ifndef dispatch_main_sync_safe
|
||||
#define dispatch_main_sync_safe(block)\
|
||||
if ([NSThread isMainThread]) {\
|
||||
block();\
|
||||
} else {\
|
||||
dispatch_sync(dispatch_get_main_queue(), block);\
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef dispatch_main_async_safe
|
||||
#define dispatch_main_async_safe(block)\
|
||||
if ([NSThread isMainThread]) {\
|
||||
block();\
|
||||
} else {\
|
||||
dispatch_async(dispatch_get_main_queue(), block);\
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue