exit (1);
}
} else if (!Glib::file_test (p, Glib::FILE_TEST_IS_DIR)) {
- error << string_compose (_("Configuration directory %1 already exists and is not a directory/folder - cannot run"),
+ fatal << string_compose (_("Configuration directory %1 already exists and is not a directory/folder - cannot run"),
p) << endmsg;
- exit (1);
+ abort(); /*NOTREACHED*/
}
}
} else if (!Glib::file_test (p, Glib::FILE_TEST_IS_DIR)) {
fatal << string_compose (_("Cache directory %1 already exists and is not a directory/folder - cannot run"),
p) << endmsg;
- exit (1);
+ abort(); /*NOTREACHED*/
}
return p;
ardour_dll_directory ()
{
#ifdef PLATFORM_WINDOWS
- std::string dll_dir_path(g_win32_get_package_installation_directory_of_module(NULL));
+ std::string dll_dir_path(windows_package_directory_path());
dll_dir_path = Glib::build_filename (dll_dir_path, "lib");
return Glib::build_filename (dll_dir_path, LIBARDOUR);
#else
Searchpath
windows_search_path ()
{
- std::string dll_dir_path(g_win32_get_package_installation_directory_of_module(NULL));
+ std::string dll_dir_path(windows_package_directory_path());
dll_dir_path = Glib::build_filename (dll_dir_path, "share");
return Glib::build_filename (dll_dir_path, LIBARDOUR);
}
+
+std::string
+windows_package_directory_path ()
+{
+ char* package_dir =
+ g_win32_get_package_installation_directory_of_module (NULL);
+
+ if (package_dir == NULL) {
+ fatal << string_compose (_("Cannot determine %1 package directory"),
+ PROGRAM_NAME) << endmsg;
+ abort(); /*NOTREACHED*/
+ }
+
+ std::string package_dir_path(package_dir);
+ g_free(package_dir);
+ return package_dir_path;
+}
#endif
Searchpath