diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-07-13 18:04:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-13 18:04:22 +0200 |
commit | db1eb909fe1e6067743892d7544160a1a40b9e43 (patch) | |
tree | d354d5d6ed7fdeeac486c9d89a8fb69c1ea811d9 | |
parent | 817062f8ecc82a34ad980f0081e8592291e2ff55 (diff) | |
parent | 5d54c015b2dd0a26237c00788be25b3da4cfe3dd (diff) |
Merge pull request #40261 from bruvzg/macos_mono_build
[macOS, Mono] Fix "Wdeprecated-declarations" build error.
-rw-r--r-- | modules/mono/utils/osx_utils.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/modules/mono/utils/osx_utils.cpp b/modules/mono/utils/osx_utils.cpp index 8e3e51e688..e68466b1cf 100644 --- a/modules/mono/utils/osx_utils.cpp +++ b/modules/mono/utils/osx_utils.cpp @@ -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 |