Bug 787326 - MacOS's CFSTR() does not work with const variables.

This is untested, written from gathering information on the web. MacOS
people, please try and compile GIMP!
This commit is contained in:
Jehan 2017-09-09 14:37:32 +02:00
parent 1773cd91a2
commit 54b4d1e0a2
1 changed files with 39 additions and 32 deletions

View File

@ -62,15 +62,20 @@ file_raw_get_executable_path (const gchar *main_executable,
#if defined (GDK_WINDOWING_QUARTZ)
if (mac_bundle_id)
{
CFStringRef bundle_id;
/* For macOS, attempt searching for an app bundle first. */
bundle_id = CFStringCreateWithCString (NULL, mac_bundle_id,
kCFStringEncodingUTF8);
if (bundle_id)
{
OSStatus status;
CFURLRef bundle_url = NULL;
/* For macOS, attempt searching for a darktable app bundle first. */
status = LSFindApplicationForInfo (kLSUnknownCreator,
CFSTR (mac_bundle_id),
NULL, NULL, &bundle_url);
bundle_id, NULL, NULL,
&bundle_url);
if (status >= 0)
{
CFBundleRef bundle;
@ -103,6 +108,8 @@ file_raw_get_executable_path (const gchar *main_executable,
if (ret)
return ret;
}
CFRelease (bundle_id);
}
/* else, app bundle was not found, try path search as last resort. */
}
#elif defined (GDK_WINDOWING_WIN32)