From 350dff446481b9e274e54dc727141f0dbfec0b23 Mon Sep 17 00:00:00 2001 From: mstembera Date: Thu, 15 Mar 2018 21:34:38 -0700 Subject: [PATCH] Fix an MSVC 2017 error and warnings. Improved version by @mcostalba. No functional change. --- src/evaluate.cpp | 3 ++- src/misc.cpp | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index fee181ae..bb60107d 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -417,7 +417,8 @@ namespace { // Main king safety evaluation if (kingAttackersCount[Them] > 1 - pos.count(Them)) { - int kingDanger = unsafeChecks = 0; + int kingDanger = 0; + unsafeChecks = 0; // Attacked squares defended at most once by our queen or king weak = attackedBy[Them][ALL_PIECES] diff --git a/src/misc.cpp b/src/misc.cpp index 86c16d36..4e2d4057 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -23,6 +23,11 @@ #undef _WIN32_WINNT #define _WIN32_WINNT 0x0601 // Force to include needed API prototypes #endif + +#ifndef NOMINMAX +#define NOMINMAX +#endif + #include // The needed Windows API for processor groups could be missed from old Windows // versions, so instead of calling them directly (forcing the linker to resolve -- 2.39.2