Compilation fix on MSYS2-MinGW-w64 toolchain

I attach a patch to resolve a compilation issue when compile under MSYS2-MinGW-w64 toolchain. I use the version present in the MSYS2-MinGW-w64 repository, but I think it is better to report it here.

change.diff