From c87ae5612ac1a974c177741c0e400bac7f4d2c45 Mon Sep 17 00:00:00 2001 From: Michael Krasnyk Date: Thu, 5 May 2016 11:19:27 +0200 Subject: [PATCH 1/2] Fix #2362 by using generic path strings In windows native strings in Lua incorrectly interpreted because native separators must be escaped. Use of generic strings prevent use of backslashes and "Generic paths are portable and independent of the operating system.". --- include/util/lua_util.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/util/lua_util.hpp b/include/util/lua_util.hpp index 4d4fe17be..4af7473f9 100644 --- a/include/util/lua_util.hpp +++ b/include/util/lua_util.hpp @@ -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) { boost::filesystem::path profile_path = boost::filesystem::canonical(file_name); - std::string folder = profile_path.parent_path().string(); - // TODO: This code is most probably not Windows safe since it uses UNIX'ish path delimiters + std::string folder = profile_path.parent_path().generic_string(); const std::string lua_code = "package.path = \"" + folder + "/?.lua;\" .. package.path"; luaL_dostring(lua_state, lua_code.c_str()); } From 2c8cf26e74fc210a9053fa93ed4a0c8db64c2370 Mon Sep 17 00:00:00 2001 From: Michael Krasnyk Date: Thu, 5 May 2016 13:24:27 +0200 Subject: [PATCH 2/2] Fix build break in MSVC fatal error C1189: #error: "This header can't be used in operating systems without XSI (System V) shared memory support" --- include/storage/shared_memory.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/storage/shared_memory.hpp b/include/storage/shared_memory.hpp index 47238cfdf..9ceef7d76 100644 --- a/include/storage/shared_memory.hpp +++ b/include/storage/shared_memory.hpp @@ -7,7 +7,7 @@ #include #include #include -#ifndef WIN32 +#ifndef _WIN32 #include #else #include @@ -39,7 +39,7 @@ struct OSRMLockFile } }; -#ifndef WIN32 +#ifndef _WIN32 class SharedMemory {