Don't ignore -Wcompletion-handler if compiler doesn't understand it (#1894)

* Don't ignore -Wcompletion-handler if compiler doesn't understand it

Older Xcode versions threw a warning at not recognizing this warning.

* Silence WKWebView warning too
This commit is contained in:
Mayur Pawashe authored and GitHub committed 2021-07-16 07:54:19 -07:00
1 parent 9c360b465b
commit a09aad7ca0
4 files changed
+25

No files matched your search

+4
View File
@@ -66,7 +66,9 @@
}
#pragma clang diagnostic push
#if __has_warning("-Wcompletion-handler")
#pragma clang diagnostic ignored "-Wcompletion-handler"
#endif
- (void)resumeInstallingUpdateWithCompletion:(SPUUpdateDriverCompletion)__unused completionBlock
#pragma clang diagnostic pop
{
@@ -75,7 +77,9 @@
}
#pragma clang diagnostic push
#if __has_warning("-Wcompletion-handler")
#pragma clang diagnostic ignored "-Wcompletion-handler"
#endif
- (void)resumeUpdate:(id<SPUResumableUpdate>)__unused resumableUpdate completion:(SPUUpdateDriverCompletion)__unused completionBlock
#pragma clang diagnostic pop
{
+6
View File
@@ -347,7 +347,9 @@
launcherConnection.invalidationHandler = ^{
dispatch_async(dispatch_get_main_queue(), ^{
#pragma clang diagnostic push
#if __has_warning("-Wcompletion-handler")
#pragma clang diagnostic ignored "-Wcompletion-handler"
#endif
if (!madeReply) {
#pragma clang diagnostic pop
// If something went horribly wrong, just guess that we won't require authorization
@@ -371,7 +373,9 @@
[installerLauncher checkIfApplicationInstallationRequiresAuthorizationWithHostBundlePath:self.host.bundlePath reply:^(BOOL requiresAuthorization) {
dispatch_async(dispatch_get_main_queue(), ^{
#pragma clang diagnostic push
#if __has_warning("-Wcompletion-handler")
#pragma clang diagnostic ignored "-Wcompletion-handler"
#endif
if (!madeReply) {
#pragma clang diagnostic pop
madeReply = YES;
@@ -410,7 +414,9 @@
launcherConnection.invalidationHandler = ^{
dispatch_async(dispatch_get_main_queue(), ^{
#pragma clang diagnostic push
#if __has_warning("-Wcompletion-handler")
#pragma clang diagnostic ignored "-Wcompletion-handler"
#endif
if (!retrievedLaunchStatus) {
#pragma clang diagnostic pop
NSError *error =
+12
View File
@@ -39,7 +39,9 @@
[installerStatus setInvalidationHandler:^{
dispatch_async(dispatch_get_main_queue(), ^{
#pragma clang diagnostic push
#if __has_warning("-Wcompletion-handler")
#pragma clang diagnostic ignored "-Wcompletion-handler"
#endif
if (!handledCompletion) {
#pragma clang diagnostic pop
completionHandler(NO);
@@ -54,7 +56,9 @@
[installerStatus probeStatusConnectivityWithReply:^{
dispatch_async(dispatch_get_main_queue(), ^{
#pragma clang diagnostic push
#if __has_warning("-Wcompletion-handler")
#pragma clang diagnostic ignored "-Wcompletion-handler"
#endif
if (!handledCompletion) {
#pragma clang diagnostic pop
completionHandler(YES);
@@ -65,7 +69,9 @@
}];
#pragma clang diagnostic push
#if __has_warning("-Wcompletion-handler")
#pragma clang diagnostic ignored "-Wcompletion-handler"
#endif
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(PROBE_TIMEOUT * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if (!handledCompletion) {
#pragma clang diagnostic pop
@@ -96,7 +102,9 @@
[installerStatus setInvalidationHandler:^{
dispatch_async(dispatch_get_main_queue(), ^{
#pragma clang diagnostic push
#if __has_warning("-Wcompletion-handler")
#pragma clang diagnostic ignored "-Wcompletion-handler"
#endif
if (!handledCompletion) {
#pragma clang diagnostic pop
completionHandler(nil);
@@ -116,7 +124,9 @@
dispatch_async(dispatch_get_main_queue(), ^{
#pragma clang diagnostic push
#if __has_warning("-Wcompletion-handler")
#pragma clang diagnostic ignored "-Wcompletion-handler"
#endif
if (!handledCompletion) {
#pragma clang diagnostic pop
completionHandler(installationInfo);
@@ -128,7 +138,9 @@
}];
#pragma clang diagnostic push
#if __has_warning("-Wcompletion-handler")
#pragma clang diagnostic ignored "-Wcompletion-handler"
#endif
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(PROBE_TIMEOUT * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if (!handledCompletion) {
#pragma clang diagnostic pop
+3
View File
@@ -68,7 +68,10 @@ static WKUserScript *_userScriptWithInjectedStyleSource(NSString *styleSource)
// that involves implementing a delegate method that is only available on macOS 11.. to get it properly working.
// To simplify things, just rely on deprecated property for now.
// Future reader: if you change how JS is disabled, please be sure to test that JS code is properly disabled in HTML release notes.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
configuration.preferences.javaScriptEnabled = javaScriptEnabled;
#pragma clang diagnostic pop
configuration.preferences.javaScriptCanOpenWindowsAutomatically = NO;
NSError *colorStyleContentsError = nil;