X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmisc.cpp;h=e6a29af78366684a28a3056e4f5a8f4c01964e66;hp=2eb62f3e4ff7e4fbf6d01845337e10b5fe6284d9;hb=06a853eb9c5173c30b31e75d0828c29dd65ebca4;hpb=378c8bdbb8f930472fc4316aa6c417802294bbad diff --git a/src/misc.cpp b/src/misc.cpp index 2eb62f3e..e6a29af7 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 @@ -51,7 +56,7 @@ namespace { /// Version number. If Version is left empty, then compile date in the format /// DD-MM-YY and show in engine_info. -const string Version = "9"; +const string Version = ""; /// Our fancy logging facility. The trick here is to replace cin.rdbuf() and /// cout.rdbuf() with two Tie objects that tie cin and cout to a file stream. We @@ -233,7 +238,7 @@ int get_group(size_t idx) { // Early exit if the needed API is not available at runtime HMODULE k32 = GetModuleHandle("Kernel32.dll"); - auto fun1 = (fun1_t)GetProcAddress(k32, "GetLogicalProcessorInformationEx"); + auto fun1 = (fun1_t)(void(*)())GetProcAddress(k32, "GetLogicalProcessorInformationEx"); if (!fun1) return -1; @@ -301,8 +306,8 @@ void bindThisThread(size_t idx) { // Early exit if the needed API are not available at runtime HMODULE k32 = GetModuleHandle("Kernel32.dll"); - auto fun2 = (fun2_t)GetProcAddress(k32, "GetNumaNodeProcessorMaskEx"); - auto fun3 = (fun3_t)GetProcAddress(k32, "SetThreadGroupAffinity"); + auto fun2 = (fun2_t)(void(*)())GetProcAddress(k32, "GetNumaNodeProcessorMaskEx"); + auto fun3 = (fun3_t)(void(*)())GetProcAddress(k32, "SetThreadGroupAffinity"); if (!fun2 || !fun3) return;