Fix MinGW build.
Merge branch 'master' into v2.1