Revised for latest MinGW, MSVC.