From 8826031a9145cc94f66e433ea0c4e7681054e972 Mon Sep 17 00:00:00 2001 From: Mikael Date: Fri, 5 Feb 2016 15:32:18 +0900 Subject: [PATCH] Updated dispatch_ macro in order to avoid redefinition when included as Pod --- SDWebImage/SDWebImageCompat.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SDWebImage/SDWebImageCompat.h b/SDWebImage/SDWebImageCompat.h index 3c21b413..c0e0a807 100644 --- a/SDWebImage/SDWebImageCompat.h +++ b/SDWebImage/SDWebImageCompat.h @@ -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