mirror of
https://github.com/godotengine/godot.git
synced 2024-11-28 23:22:38 +00:00
[macOS, Mono] Fix "Wdeprecated-declarations" build error.
(cherry picked from commit 5d54c015b2
)
This commit is contained in:
parent
9d0d9ff424
commit
12e10457e1
@ -38,24 +38,21 @@
|
||||
#include <CoreServices/CoreServices.h>
|
||||
|
||||
bool osx_is_app_bundle_installed(const String &p_bundle_id) {
|
||||
CFURLRef app_url = NULL;
|
||||
CFStringRef bundle_id = CFStringCreateWithCString(NULL, p_bundle_id.utf8(), kCFStringEncodingUTF8);
|
||||
OSStatus result = LSFindApplicationForInfo(kLSUnknownCreator, bundle_id, NULL, NULL, &app_url);
|
||||
CFStringRef bundle_id = CFStringCreateWithCString(nullptr, p_bundle_id.utf8(), kCFStringEncodingUTF8);
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user