}
#include <boost/algorithm/string.hpp>
#include <boost/foreach.hpp>
+#include <boost/dll/runtime_symbol_info.hpp>
#include <sys/sysctl.h>
#include <mach-o/dyld.h>
#include <IOKit/pwr_mgt/IOPMLib.h>
boost::filesystem::path
app_contents ()
{
- uint32_t size = 1024;
- char buffer[size];
- if (_NSGetExecutablePath (buffer, &size)) {
- throw runtime_error ("_NSGetExecutablePath failed");
- }
-
- boost::filesystem::path path (buffer);
- path = boost::filesystem::canonical (path);
- path = path.parent_path ();
- path = path.parent_path ();
- return path;
+ std::cout << "program_location=" << boost::dll::program_location() << "\n";
+ return boost::dll::program_location().parent_path().parent_path();
}
boost::filesystem::path
}
boost::filesystem::path
-dist_writer_path ()
+disk_writer_path ()
{
boost::filesystem::path path = app_contents();
path /= "MacOS";
- path /= "dcpomatic2_dist_writer";
+ path /= "dcpomatic2_disk_writer";
return path;
}
{
const char* name = DADiskGetBSDName (disk);
if (name) {
- list<Drive>* drives = reinterpret_cast<list<Drive>*> (context);
+ vector<Drive>* drives = reinterpret_cast<vector<Drive>*> (context);
drives->push_back (Drive(name, 0, false, optional<string>(), optional<string>()));
}
}