fix mingw32/mingw64 compiling
Merge pull request #6912 from John-He-928/mingw-build

fix mingw32/mingw64 compiling