From ccc66b48a1eebb1d44748ac8fa5c16be95626ca0 Mon Sep 17 00:00:00 2001 From: funbiscuit Date: Tue, 5 May 2020 14:15:54 +0300 Subject: [PATCH] Fix compilation on Windows Increment version --- .appveyor.yml | 2 +- appveyor-build.ps1 | 10 +++++----- build-win-msvc14_x64.bat | 2 +- build-win-msvc15_x64.bat | 2 +- lib/src/platformutils-win.cpp | 4 ++-- lib/src/spacewatcher-win.cpp | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 5841961..44cd4da 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,4 +1,4 @@ -version: 0.3.0.{build} +version: 0.3.1.{build} image: - Visual Studio 2017 diff --git a/appveyor-build.ps1 b/appveyor-build.ps1 index e4e353b..80cee6d 100644 --- a/appveyor-build.ps1 +++ b/appveyor-build.ps1 @@ -26,10 +26,10 @@ for($i = 0; $i -lt $vc_arch.length; $i++){ $cv = $cmd_var[$k] # create build dir if it was not restored from cache if(!(test-path "build$cs-$vc")){ mkdir "build$cs-$vc" } - cd "build$cs-$vc" + Set-Location "build$cs-$vc" cmake -DQT_WIN_PATH="$qt_path" -DWIN32_CONSOLE="$cv" -G "Visual Studio 15 2017$vc_gen_sfx" .. cmake --build . --config Release - cd .. + Set-Location .. # create folders for binaries mkdir "bin$cs-$vc" @@ -37,14 +37,14 @@ for($i = 0; $i -lt $vc_arch.length; $i++){ mkdir "bin$cs-$vc\styles" # copy executable and dll's - copy "build$cs-$vc\app-gui\Release\spacedisplay_gui.exe" "bin$cs-$vc\spacedisplay.exe" + Move-Item "build$cs-$vc\app-gui\Release\spacedisplay_gui.exe" "bin$cs-$vc\spacedisplay.exe" for($j = 0; $j -lt $qt_dlls.length; $j++){ $dll = $qt_dlls[$j] - copy "$qt_path\bin\$dll" "bin$cs-$vc\$dll" + Copy-Item "$qt_path\bin\$dll" "bin$cs-$vc\$dll" } for($j = 0; $j -lt $qt_plug.length; $j++){ $dll = $qt_plug[$j] - copy "$qt_path\plugins\$dll" "bin$cs-$vc\$dll" + Copy-Item "$qt_path\plugins\$dll" "bin$cs-$vc\$dll" } } } diff --git a/build-win-msvc14_x64.bat b/build-win-msvc14_x64.bat index 3ec7418..940cf24 100644 --- a/build-win-msvc14_x64.bat +++ b/build-win-msvc14_x64.bat @@ -12,5 +12,5 @@ if not exist "bin\" mkdir bin cd cmake-build-msvc14_x64-release %cmake_path% "-DQT_WIN_PATH=D:\Qt\5.14.2\msvc2015_64" -G "Visual Studio 14 2015 Win64" .. %cmake_path% --build . --config Release --target spacedisplay_gui -copy app-gui\Release\spacedisplay_gui.exe ..\bin\spacedisplay_gui.exe +move app-gui\Release\spacedisplay_gui.exe ..\bin\spacedisplay_gui.exe cd .. diff --git a/build-win-msvc15_x64.bat b/build-win-msvc15_x64.bat index 75d09ea..529de40 100644 --- a/build-win-msvc15_x64.bat +++ b/build-win-msvc15_x64.bat @@ -12,5 +12,5 @@ if not exist "bin\" mkdir bin cd cmake-build-msvc15_x64-release %cmake_path% "-DQT_WIN_PATH=D:\Qt\5.14.2\msvc2017_64" -G "Visual Studio 15 2017 Win64" .. %cmake_path% --build . --config Release --target spacedisplay_gui -copy app-gui\Release\spacedisplay_gui.exe ..\bin\spacedisplay_gui.exe +move app-gui\Release\spacedisplay_gui.exe ..\bin\spacedisplay_gui.exe cd .. diff --git a/lib/src/platformutils-win.cpp b/lib/src/platformutils-win.cpp index f3c2ea5..a5a8e30 100644 --- a/lib/src/platformutils-win.cpp +++ b/lib/src/platformutils-win.cpp @@ -178,7 +178,7 @@ bool PlatformUtils::get_mount_space(const std::string& path, uint64_t& totalSpac void PlatformUtils::open_folder_in_file_manager(const char* folder_path) { - auto pars = string_format("/n,\"%s\"", folder_path); + auto pars = Utils::strFormat("/n,\"%s\"", folder_path); auto parsw = str2wstr(pars); std::wcout << L"Launch explorer with args: " << parsw << '\n'; @@ -188,7 +188,7 @@ void PlatformUtils::open_folder_in_file_manager(const char* folder_path) void PlatformUtils::show_file_in_file_manager(const char* file_path) { - auto pars = string_format("/select,\"%s\"", file_path); + auto pars = Utils::strFormat("/select,\"%s\"", file_path); auto parsw = str2wstr(pars); std::wcout << L"Launch explorer with args: " << parsw << '\n'; diff --git a/lib/src/spacewatcher-win.cpp b/lib/src/spacewatcher-win.cpp index 306aecc..fa7d4fe 100644 --- a/lib/src/spacewatcher-win.cpp +++ b/lib/src/spacewatcher-win.cpp @@ -92,7 +92,7 @@ void SpaceWatcherWin::readEvents() // minimum size is 4, so do nothing until we receive it if(dwords>3) { - int currentDword=0; + size_t currentDword=0; while(true) {