diff --git a/src/engine/helper/CMakeLists.txt b/src/engine/helper/CMakeLists.txt index 7b8226c1..cd318d7c 100644 --- a/src/engine/helper/CMakeLists.txt +++ b/src/engine/helper/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.15) project (helper_lib) # Rely on C++ 11 -set (CMAKE_CXX_STANDARD 11) +set (CMAKE_CXX_STANDARD 20) set (CMAKE_CXX_STANDARD_REQUIRED ON) option (USE_NULL_UUID "When enabled linking to libuuid is avoided" OFF) diff --git a/src/engine/helper/HL_Process.cpp b/src/engine/helper/HL_Process.cpp index 3e1b60bd..cbef6bf9 100644 --- a/src/engine/helper/HL_Process.cpp +++ b/src/engine/helper/HL_Process.cpp @@ -39,7 +39,7 @@ std::string OsProcess::execCommand(const std::string& cmd) PROCESS_INFORMATION pi = { 0 }; char* cmdline = (char*)_alloca(cmd.size()+1); - strcpy(cmdline, StringHelper::replace(cmd, "/", "\\").c_str()); + strcpy(cmdline, strx::replace(cmd, "/", "\\").c_str()); BOOL fSuccess = CreateProcessA( nullptr, cmdline, NULL, NULL, TRUE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi); if (! fSuccess) @@ -114,7 +114,7 @@ std::shared_ptr OsProcess::asyncExecCommand(const std::string& cmdl memset(&pi, 0, sizeof pi); char* cmdbuffer = (char*)_alloca(cmdline.size()+1); - strcpy(cmdbuffer, StringHelper::replace(cmdline, "/", "\\").c_str()); + strcpy(cmdbuffer, strx::replace(cmdline, "/", "\\").c_str()); BOOL fSuccess = CreateProcessA( nullptr, cmdbuffer, nullptr, nullptr, TRUE, @@ -160,14 +160,14 @@ std::shared_ptr OsProcess::asyncExecCommand(const std::string& cmdl { std::string line(buf, cr - buf -1); if (callback) - callback(StringHelper::trim(line)); + callback(strx::trim(line)); memmove(buf, cr + 1, strlen(cr+1) + 1); } } } //for if (buf[0]) - callback(StringHelper::trim(std::string(buf))); + callback(strx::trim(std::string(buf))); char ctrlc = 3; //if (finish_flag) diff --git a/src/engine/helper/HL_Time.cpp b/src/engine/helper/HL_Time.cpp index 9bfa995f..49128118 100644 --- a/src/engine/helper/HL_Time.cpp +++ b/src/engine/helper/HL_Time.cpp @@ -1,10 +1,17 @@ #include "HL_Time.h" #include - +#include /* return current time in milliseconds */ -double now_ms(void) { +double now_ms(void) +{ +#if defined(TARGET_WIN) + auto tp = std::chrono::steady_clock::now(); + auto result = std::chrono::duration_cast(tp.time_since_epoch()).count(); + return result; +#else struct timespec res; clock_gettime(CLOCK_MONOTONIC, &res); return 1000.0 * res.tv_sec + (double) res.tv_nsec / 1e6; -} \ No newline at end of file +#endif +} diff --git a/src/libs/resiprocate b/src/libs/resiprocate index 34425a74..0a786d3a 160000 --- a/src/libs/resiprocate +++ b/src/libs/resiprocate @@ -1 +1 @@ -Subproject commit 34425a748bcad9235b58f97da25577947c501844 +Subproject commit 0a786d3a7a49057ba31bf82a91269819f713c985