fix build problems on latest mingw