X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmisc.cpp;h=e6a29af78366684a28a3056e4f5a8f4c01964e66;hp=86c16d36174d3e0bac9616efa54bcb532312219e;hb=06a853eb9c5173c30b31e75d0828c29dd65ebca4;hpb=83c828f31ef3c18dd3718f7935484111872e7ecd diff --git a/src/misc.cpp b/src/misc.cpp index 86c16d36..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 @@ -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;