Merge pull request #40261 from bruvzg/macos_mono_build
[macOS, Mono] Fix "Wdeprecated-declarations" build error.
This commit is contained in:
commit
db1eb909fe
|
@ -38,24 +38,21 @@
|
||||||
#include <CoreServices/CoreServices.h>
|
#include <CoreServices/CoreServices.h>
|
||||||
|
|
||||||
bool osx_is_app_bundle_installed(const String &p_bundle_id) {
|
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);
|
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);
|
CFRelease(bundle_id);
|
||||||
|
|
||||||
if (app_url)
|
if (result) {
|
||||||
CFRelease(app_url);
|
if (CFArrayGetCount(result) > 0) {
|
||||||
|
CFRelease(result);
|
||||||
switch (result) {
|
|
||||||
case noErr:
|
|
||||||
return true;
|
return true;
|
||||||
case kLSApplicationNotFoundErr:
|
} else {
|
||||||
break;
|
CFRelease(result);
|
||||||
default:
|
return false;
|
||||||
break;
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue