From e15a1a92febce5966a962e1481247b8537c545cf Mon Sep 17 00:00:00 2001 From: "Oleg.Korshul" Date: Sat, 15 Oct 2022 22:04:51 +0300 Subject: [PATCH] Fix compile for linux/macos --- Test/Applications/x2tTester/main.cpp | 15 +++++++++++---- Test/Applications/x2tTester/x2tTester.cpp | 4 ++-- X2tConverter/src/run.h | 6 ++++++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Test/Applications/x2tTester/main.cpp b/Test/Applications/x2tTester/main.cpp index 64ae8f84b5..f5c85139bc 100644 --- a/Test/Applications/x2tTester/main.cpp +++ b/Test/Applications/x2tTester/main.cpp @@ -19,10 +19,17 @@ int main(int argc, char** argv) std::wstring config_path; - if(argc < 2) config_path = L"./config.xml"; - else config_path = std::wstring(argv[1]); - - SetConsoleOutputCP(CP_UTF8); + if(argc < 2) + config_path = L"./config.xml"; + else + { +#ifdef WIN32 + config_path = std::wstring(argv[1]); +#else + std::string config_pathA = std::string(argv[1]); + config_path = UTF8_TO_U(config_pathA); +#endif + } Cx2tTester tester(config_path); tester.Start(); diff --git a/Test/Applications/x2tTester/x2tTester.cpp b/Test/Applications/x2tTester/x2tTester.cpp index 09567f60b4..db4f05b3f9 100644 --- a/Test/Applications/x2tTester/x2tTester.cpp +++ b/Test/Applications/x2tTester/x2tTester.cpp @@ -263,7 +263,7 @@ void Cx2tTester::Start() // waiting... while(isAllBusy()) - Sleep(100); + NSThreads::Sleep(100); // setup & start new coverter m_currentProc++; @@ -281,7 +281,7 @@ void Cx2tTester::Start() // waiting all procs end while(!isAllFree()) - Sleep(100); + NSThreads::Sleep(100); } void Cx2tTester::writeReport(const Report& report) diff --git a/X2tConverter/src/run.h b/X2tConverter/src/run.h index 5634dccce6..1763686562 100644 --- a/X2tConverter/src/run.h +++ b/X2tConverter/src/run.h @@ -36,6 +36,12 @@ #include "../../DesktopEditor/common/StringBuilder.h" #include "../../DesktopEditor/graphics/BaseThread.h" +#ifdef _LINUX +#include +#include +#include +#endif + namespace NSX2T { int Convert(const std::wstring& sConverterDirectory, const std::wstring sXmlPath)