updated for mingw64 and mingw32