Changes to support building on mingw.