From 6500bf8c2f5104af89bf11739bf2728c654eaa6e Mon Sep 17 00:00:00 2001 From: hofman Date: Wed, 13 Mar 2019 23:03:10 +0100 Subject: [PATCH] Use SUAVAILABLE macro in SUUpdateAlert.m --- Sparkle/SUUpdateAlert.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Sparkle/SUUpdateAlert.m b/Sparkle/SUUpdateAlert.m index 2eb73ef0..59ddd32e 100644 --- a/Sparkle/SUUpdateAlert.m +++ b/Sparkle/SUUpdateAlert.m @@ -21,6 +21,7 @@ #import "SUAppcastItem.h" #import "SUApplicationInfo.h" #import "SUSystemUpdateInfo.h" +#import "SUOperatingSystem.h" #import "SUTouchBarForwardDeclarations.h" #import "SUTouchBarButtonGroup.h" @@ -97,7 +98,7 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE - (void)dealloc { #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101400 - if (@available(macOS 10.14, *)) { + if (SUAVAILABLE(10, 14)) { if (self.observingAppearance) { [self.window removeObserver:self forKeyPath:@"effectiveAppearance"]; self.observingAppearance = NO; @@ -167,7 +168,7 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE prefs.defaultFontSize = (int)[NSFont systemFontSize]; #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101400 - if (@available(macOS 10.14, *)) + if (SUAVAILABLE(10, 14)) { NSBox *darkBackgroundView = [[NSBox alloc] initWithFrame:self.releaseNotesView.frame]; darkBackgroundView.boxType = NSBoxCustom; @@ -308,11 +309,14 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE - (void)adaptReleaseNotesAppearance { #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101400 - if (@available(macOS 10.14, *)) + if (SUAVAILABLE(10, 14)) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunguarded-availability" NSAppearanceName bestAppearance = [self.window.effectiveAppearance bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]]; BOOL isDarkAqua = ([bestAppearance isEqualToString:NSAppearanceNameDarkAqua]); self.releaseNotesView.preferences.userStyleSheetEnabled = isDarkAqua; +#pragma clang diagnostic pop } #endif }