From e4243aa13b525af2aa7e5c61b20d1e6f5103e475 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Wed, 29 Nov 2023 17:52:23 +0800 Subject: [PATCH] Ignore the availability warning --- SDWebImage/Private/SDDisplayLink.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/SDWebImage/Private/SDDisplayLink.m b/SDWebImage/Private/SDDisplayLink.m index 0472a2f7..f595f79a 100644 --- a/SDWebImage/Private/SDDisplayLink.m +++ b/SDWebImage/Private/SDDisplayLink.m @@ -17,7 +17,9 @@ #if SD_MAC static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp *inNow, const CVTimeStamp *inOutputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, void *displayLinkContext); -#else +#endif + +#if SD_UIKIT static BOOL kSDDisplayLinkUseTargetTimestamp = NO; // Use `next` fire time, or `previous` fire time (only for CADisplayLink) #endif @@ -91,6 +93,8 @@ static BOOL kSDDisplayLinkUseTargetTimestamp = NO; // Use `next` fire time, or ` return displayLink; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunguarded-availability" - (NSTimeInterval)duration { NSTimeInterval duration = 0; #if SD_MAC @@ -155,6 +159,7 @@ static BOOL kSDDisplayLinkUseTargetTimestamp = NO; // Use `next` fire time, or ` } return duration; } +#pragma clang diagnostic pop - (BOOL)isRunning { #if SD_MAC @@ -240,6 +245,8 @@ static BOOL kSDDisplayLinkUseTargetTimestamp = NO; // Use `next` fire time, or ` self.nextFireTime = 0; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunguarded-availability" - (void)displayLinkDidRefresh:(id)displayLink { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Warc-performSelector-leaks" @@ -256,6 +263,7 @@ static BOOL kSDDisplayLinkUseTargetTimestamp = NO; // Use `next` fire time, or ` self.nextFireTime = CFRunLoopTimerGetNextFireDate((__bridge CFRunLoopTimerRef)self.displayLink); #endif } +#pragma clang diagnostic pop @end