This fix includes some fixes for config.h.win32 that was generating some compiling errors on MinGW64 and also fix CMakeLists.txt in order to give better support to MinGW and MSYS2