diff --git a/Autoupdate/SUDiskImageUnarchiver.m b/Autoupdate/SUDiskImageUnarchiver.m index d32041352b..a7a3ae4b10 100644 --- a/Autoupdate/SUDiskImageUnarchiver.m +++ b/Autoupdate/SUDiskImageUnarchiver.m @@ -132,10 +132,7 @@ - (void)extractDMGWithNotifier:(SUUnarchiverNotifier *)notifier SPU_OBJC_DIRECT [inputPipe.fileHandleForWriting writeData:promptData]; -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_15 - if (@available(macOS 10.15, *)) -#endif - { + if (@available(macOS 10.15, *)) { if (![inputPipe.fileHandleForWriting writeData:promptData error:&error]) { goto reportError; } diff --git a/Autoupdate/SUPipedUnarchiver.m b/Autoupdate/SUPipedUnarchiver.m index fcc24aa77f..6c3018f65c 100644 --- a/Autoupdate/SUPipedUnarchiver.m +++ b/Autoupdate/SUPipedUnarchiver.m @@ -188,10 +188,7 @@ - (void)extractArchivePipingDataToCommand:(NSString *)command arguments:(NSArray } while(bytesWritten < expectedLength); -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_15 - if (@available(macOS 10.15, *)) -#endif - { + if (@available(macOS 10.15, *)) { NSError *archiveOutputCloseError = nil; if (![archiveOutput closeAndReturnError:&archiveOutputCloseError]) { SULog(SULogLevelError, @"Failed to close pipe with error %@", archiveOutputCloseError); @@ -204,10 +201,7 @@ - (void)extractArchivePipingDataToCommand:(NSString *)command arguments:(NSArray } #endif -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_15 - if (@available(macOS 10.15, *)) -#endif - { + if (@available(macOS 10.15, *)) { NSError *archiveInputCloseError = nil; if (![archiveInput closeAndReturnError:&archiveInputCloseError]) { SULog(SULogLevelError, @"Failed to close archive input with error %@", archiveInputCloseError); diff --git a/InstallerLauncher/SUInstallerLauncher.m b/InstallerLauncher/SUInstallerLauncher.m index 864c2b311d..e95bc71ba0 100644 --- a/InstallerLauncher/SUInstallerLauncher.m +++ b/InstallerLauncher/SUInstallerLauncher.m @@ -208,10 +208,7 @@ - (SUInstallerLauncherStatus)submitInstallerAtPath:(NSString *)installerPath wit tempIconDestinationURL = [NSURL fileURLWithPath:path]; CGImageDestinationRef imageDestination = NULL; -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_VERSION_11_0 - if (@available(macOS 11, *)) -#endif - { + if (@available(macOS 11, *)) { CFStringRef uti = (__bridge CFStringRef)[UTTypePNG identifier]; imageDestination = CGImageDestinationCreateWithURL((CFURLRef)tempIconDestinationURL, uti, 1, NULL); } diff --git a/Sparkle/SPUInstallerDriver.m b/Sparkle/SPUInstallerDriver.m index 310ef38159..4a353a8f0e 100644 --- a/Sparkle/SPUInstallerDriver.m +++ b/Sparkle/SPUInstallerDriver.m @@ -116,10 +116,7 @@ - (void)_reportInstallerError:(nullable NSError *)currentInstallerError genericE }]; // macOS 13 and later introduce a policy where Gatekeeper can block app modifications if the apps have different Team IDs -#if !defined(MAC_OS_VERSION_13_0) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_VERSION_13_0 - if (@available(macOS 13, *)) -#endif - { + if (@available(macOS 13, *)) { NSBundle *mainBundle = [NSBundle mainBundle]; if (![mainBundle isEqual:_host.bundle]) { SUHost *mainBundleHost = [[SUHost alloc] initWithBundle:mainBundle]; diff --git a/Sparkle/SUApplicationInfo.m b/Sparkle/SUApplicationInfo.m index c818395500..64fc4ea967 100644 --- a/Sparkle/SUApplicationInfo.m +++ b/Sparkle/SUApplicationInfo.m @@ -38,10 +38,7 @@ + (NSImage *)bestIconForHost:(SUHost *)host // but still better than nothing if no icon was included BOOL isMainBundle = [host.bundle isEqualTo:[NSBundle mainBundle]]; -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_VERSION_11_0 - if (@available(macOS 11, *)) -#endif - { + if (@available(macOS 11, *)) { UTType *contentType = isMainBundle ? UTTypeApplication : UTTypeBundle; icon = [[NSWorkspace sharedWorkspace] iconForContentType:contentType]; } diff --git a/Sparkle/SUPlainTextReleaseNotesView.m b/Sparkle/SUPlainTextReleaseNotesView.m index d5a505683c..bbb75fe031 100644 --- a/Sparkle/SUPlainTextReleaseNotesView.m +++ b/Sparkle/SUPlainTextReleaseNotesView.m @@ -66,10 +66,7 @@ - (void)_loadString:(NSString *)contents completionHandler:(void (^)(NSError * _ _textView.usesFontPanel = NO; _textView.editable = NO; -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_14 - if (@available(macOS 10.14, *)) -#endif - { + if (@available(macOS 10.14, *)) { _textView.usesAdaptiveColorMappingForDarkAppearance = YES; } diff --git a/Sparkle/SUUpdateAlert.m b/Sparkle/SUUpdateAlert.m index dad8e35d7b..9df799218a 100644 --- a/Sparkle/SUUpdateAlert.m +++ b/Sparkle/SUUpdateAlert.m @@ -185,10 +185,7 @@ - (void)displayReleaseNotesSpinner SPU_OBJC_DIRECT } - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(__attribute__((unused)) NSDictionary *)change context:(__attribute__((unused)) void *)context { -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_14 - if (@available(macOS 10.14, *)) -#endif - { + if (@available(macOS 10.14, *)) { if (object == _releaseNotesView.view && [keyPath isEqualToString:@"effectiveAppearance"]) { [self adaptReleaseNotesAppearance]; } @@ -196,10 +193,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(_ } - (void)dealloc { -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_14 - if (@available(macOS 10.14, *)) -#endif - { + if (@available(macOS 10.14, *)) { if (_observingAppearance) { [_releaseNotesView.view removeObserver:self forKeyPath:@"effectiveAppearance"]; _observingAppearance = NO; @@ -209,10 +203,7 @@ - (void)dealloc { - (void)adaptReleaseNotesAppearance SPU_OBJC_DIRECT { -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_14 - if (@available(macOS 10.14, *)) -#endif - { + if (@available(macOS 10.14, *)) { NSAppearanceName bestAppearance = [_releaseNotesView.view.effectiveAppearance bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]]; if ([bestAppearance isEqualToString:NSAppearanceNameDarkAqua]) {