port to mingw