import MinGW patch provided by David Millis.