Merge commit 'Quiet FSRef warnings' into master

This commit is contained in:
Kp 2018-08-26 16:14:02 +00:00
commit 6a96e30495

View file

@ -226,20 +226,20 @@ bool PHYSFSX_init(int argc, char *argv[])
// For Macintosh, add the 'Resources' directory in the .app bundle to the searchpaths
#if defined(__APPLE__) && defined(__MACH__)
{
ProcessSerialNumber psn = { 0, kCurrentProcess };
FSRef fsref;
OSStatus err;
err = GetProcessBundleLocation(&psn, &fsref);
if (err == noErr)
err = FSRefMakePath(&fsref, reinterpret_cast<uint8_t *>(fullPath), PATH_MAX);
if (err == noErr)
CFBundleRef mainBundle = CFBundleGetMainBundle();
if (mainBundle)
{
strncat(fullPath, "/Contents/Resources/", PATH_MAX + 4 - strlen(fullPath));
fullPath[PATH_MAX + 4] = '\0';
con_printf(CON_DEBUG, "PHYSFS: append resources directory \"%s\" to search path", fullPath);
PHYSFS_addToSearchPath(fullPath, 1);
CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
if (resourcesURL)
{
if (CFURLGetFileSystemRepresentation(resourcesURL, TRUE, reinterpret_cast<uint8_t *>(fullPath), sizeof(fullPath)))
{
con_printf(CON_DEBUG, "PHYSFS: append resources directory \"%s\" to search path", fullPath);
PHYSFS_addToSearchPath(fullPath, 1);
}
CFRelease(resourcesURL);
}
}
}
#elif defined(macintosh)