diff --git a/src/ocpp/ppInclude.cpp b/src/ocpp/ppInclude.cpp index d2a149413..184ac24ba 100644 --- a/src/ocpp/ppInclude.cpp +++ b/src/ocpp/ppInclude.cpp @@ -378,10 +378,17 @@ std::string ppInclude::SrchPath(bool system, const std::string& name, const std: } AddName(buf, name); +#ifdef TARGET_OS_WINDOWS while (char* p = (char*)strchr(buf, '/')) { *p = CmdFiles::DIR_SEP[0]; } +#else + while (char* p = (char*)strchr(buf, CmdFiles::DIR_SEP[0])) + { + *p = '/'; + } +#endif if (Utils::FileExists(buf)) { if (filesSkipped > 0) // we lie to ourselves about how many files we skip while searching so that we go past the @@ -489,4 +496,4 @@ bool ppInclude::GetLine(std::string& line, int& lineno) popFile(); } return false; -} \ No newline at end of file +} diff --git a/src/util/CmdSwitch.cpp b/src/util/CmdSwitch.cpp index b3fc457e6..9c48d4e61 100644 --- a/src/util/CmdSwitch.cpp +++ b/src/util/CmdSwitch.cpp @@ -365,7 +365,7 @@ bool CmdSwitchParser::Parse(int* argc, char* argv[]) (*argc)--; } else if ((argv[0][0] == '-' || - #ifdef _WIN32 + #ifdef TARGET_OS_WINDOWS argv[0][0] == '/' || #endif (argv[0][0] == '+' && argv[0][1] != '-')) && argv[0][1] && diff --git a/src/util/SharedMemory.h b/src/util/SharedMemory.h index 43579f4ef..512c7336a 100644 --- a/src/util/SharedMemory.h +++ b/src/util/SharedMemory.h @@ -42,7 +42,7 @@ class SharedMemory void SetName(); std::string name_; - unsigned max_; + const unsigned max_; const unsigned windowSize_; unsigned current_; void* fileHandle_;