(OSX) add stubbed out replacement C code using CoreFoundation for grabbing

application support dir path - figure out why it's broken
This commit is contained in:
Twinaphex 2014-10-16 19:53:39 +02:00
parent 6d4badd220
commit 1a52ce43ec

View File

@ -132,11 +132,25 @@ static char** waiting_argv;
{
apple_platform = self;
#if 1
const char* paths = [[NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) firstObject] UTF8String];
fill_pathname_join(g_defaults.core_dir, NSBundle.mainBundle.bundlePath.UTF8String, "Contents/Resources/modules", sizeof(g_defaults.core_dir));
fill_pathname_join(g_defaults.menu_config_dir, paths, "RetroArch", sizeof(g_defaults.menu_config_dir));
fill_pathname_join(g_defaults.config_path, g_defaults.menu_config_dir, "retroarch.cfg", sizeof(g_defaults.config_path));
#else
char support_path_buf[PATH_MAX + 1];
CFArrayRef array = (CFArrayRef)NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
CFStringRef support_path = (CFStringRef)CFArrayGetValueAtIndex(array, 0);
CFStringGetCString(support_path, support_path_buf, sizeof(support_path_buf), kCFStringEncodingUTF8);
fill_pathname_join(g_defaults.core_dir, NSBundle.mainBundle.bundlePath.UTF8String, "Contents/Resources/modules", sizeof(g_defaults.core_dir));
fill_pathname_join(g_defaults.menu_config_dir, support_path_buf, "RetroArch", sizeof(g_defaults.menu_config_dir));
fill_pathname_join(g_defaults.config_path, g_defaults.menu_config_dir, "retroarch.cfg", sizeof(g_defaults.config_path));
CFRelease(support_path);
CFRelease(array);
#endif
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070