From 6c859bf1d0e9d5dfce1d19f38d92ebfce7a93e6f Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sat, 26 Jan 2019 21:37:46 +0100 Subject: [PATCH] Fix compilation with VS2019 --- premake5.lua | 1 + src/game/scripting/scheduler.hpp | 8 ++++---- src/launcher/launcher.cpp | 2 +- src/std_include.hpp | 9 +++++++++ 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/premake5.lua b/premake5.lua index 17d8d9f..b097298 100644 --- a/premake5.lua +++ b/premake5.lua @@ -57,6 +57,7 @@ workspace "open-iw5" editandcontinue "Off" warnings "Extra" characterset "ASCII" + toolset "v142" flags { "NoIncrementalLink", diff --git a/src/game/scripting/scheduler.hpp b/src/game/scripting/scheduler.hpp index 660e6ff..5b36534 100644 --- a/src/game/scripting/scheduler.hpp +++ b/src/game/scripting/scheduler.hpp @@ -16,10 +16,10 @@ namespace game class task final : public task_handle { public: - std::chrono::steady_clock::time_point last_execution; - std::function callback; - std::chrono::milliseconds delay; - bool is_volatile; + std::chrono::steady_clock::time_point last_execution{}; + std::function callback{}; + std::chrono::milliseconds delay{}; + bool is_volatile = false; }; class scheduler final diff --git a/src/launcher/launcher.cpp b/src/launcher/launcher.cpp index 077dad0..4336f12 100644 --- a/src/launcher/launcher.cpp +++ b/src/launcher/launcher.cpp @@ -79,7 +79,7 @@ void launcher::select_mode(const mode mode) std::string launcher::load_content(const int res) { const auto resource = FindResource(utils::nt::module(), MAKEINTRESOURCE(res), RT_RCDATA); - if (!res) return {}; + if (!resource) return {}; const auto handle = LoadResource(nullptr, resource); if (!handle) return {}; diff --git a/src/std_include.hpp b/src/std_include.hpp index e8bbfad..5995802 100644 --- a/src/std_include.hpp +++ b/src/std_include.hpp @@ -4,8 +4,17 @@ #define TLS_PAYLOAD_SIZE 0x2000 #pragma warning(push) +#pragma warning(disable: 4244) #pragma warning(disable: 4458) #pragma warning(disable: 4702) +#pragma warning(disable: 6297) +#pragma warning(disable: 6385) +#pragma warning(disable: 6386) +#pragma warning(disable: 26451) +#pragma warning(disable: 26444) +#pragma warning(disable: 26451) +#pragma warning(disable: 26495) +#pragma warning(disable: 28020) #define WIN32_LEAN_AND_MEAN