Extended Description
On both x86 and x64 toolchains from mingw-w64.sourceforge.net, the build fails due to the assumption made that a certain winAPI function is unavailable and a different declaration is provided. This was probably necessary for mingw.org, but is bad for mingw-w64 (who are more compatible with MSVC in this regard).
A trivial patch with a check for mingw-w64 toolchain is attached. It also fixes a _WIN32_WINNT macro redefinition warning.