Patch from Alexei for enabling compilation on MinGW.