Updated dispatch_ macro in order to avoid redefinition when included as Pod

This commit is contained in:
Mikael 2016-02-05 15:32:18 +09:00
parent e41af47e2f
commit 8826031a91
1 changed files with 4 additions and 0 deletions

View File

@ -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