Merge pull request #2373 from oxidase/master

Fix #2362 by using generic path strings
This commit is contained in:
Patrick Niklaus 2016-05-05 15:57:51 +02:00
commit 238366e71f
2 changed files with 3 additions and 4 deletions

View File

@ -7,7 +7,7 @@
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp> #include <boost/filesystem/fstream.hpp>
#include <boost/interprocess/mapped_region.hpp> #include <boost/interprocess/mapped_region.hpp>
#ifndef WIN32 #ifndef _WIN32
#include <boost/interprocess/xsi_shared_memory.hpp> #include <boost/interprocess/xsi_shared_memory.hpp>
#else #else
#include <boost/interprocess/shared_memory_object.hpp> #include <boost/interprocess/shared_memory_object.hpp>
@ -39,7 +39,7 @@ struct OSRMLockFile
} }
}; };
#ifndef WIN32 #ifndef _WIN32
class SharedMemory class SharedMemory
{ {

View File

@ -43,8 +43,7 @@ inline bool luaFunctionExists(lua_State *lua_state, const char *name)
inline void luaAddScriptFolderToLoadPath(lua_State *lua_state, const char *file_name) inline void luaAddScriptFolderToLoadPath(lua_State *lua_state, const char *file_name)
{ {
boost::filesystem::path profile_path = boost::filesystem::canonical(file_name); boost::filesystem::path profile_path = boost::filesystem::canonical(file_name);
std::string folder = profile_path.parent_path().string(); std::string folder = profile_path.parent_path().generic_string();
// TODO: This code is most probably not Windows safe since it uses UNIX'ish path delimiters
const std::string lua_code = "package.path = \"" + folder + "/?.lua;\" .. package.path"; const std::string lua_code = "package.path = \"" + folder + "/?.lua;\" .. package.path";
luaL_dostring(lua_state, lua_code.c_str()); luaL_dostring(lua_state, lua_code.c_str());
} }