patch to build on mingw