Merge pull request #40261 from bruvzg/macos_mono_build

[macOS, Mono] Fix "Wdeprecated-declarations" build error.
This commit is contained in:
Rémi Verschelde 2020-07-13 18:04:22 +02:00 committed by GitHub
commit db1eb909fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 13 deletions

View File

@ -38,24 +38,21 @@
#include <CoreServices/CoreServices.h>
bool osx_is_app_bundle_installed(const String &p_bundle_id) {
CFURLRef app_url = nullptr;
CFStringRef bundle_id = CFStringCreateWithCString(nullptr, p_bundle_id.utf8(), kCFStringEncodingUTF8);
OSStatus result = LSFindApplicationForInfo(kLSUnknownCreator, bundle_id, nullptr, nullptr, &app_url);
CFArrayRef result = LSCopyApplicationURLsForBundleIdentifier(bundle_id, nullptr);
CFRelease(bundle_id);
if (app_url)
CFRelease(app_url);
switch (result) {
case noErr:
if (result) {
if (CFArrayGetCount(result) > 0) {
CFRelease(result);
return true;
case kLSApplicationNotFoundErr:
break;
default:
break;
} else {
CFRelease(result);
return false;
}
} else {
return false;
}
return false;
}
#endif