mingw support.

Changes needed to support mingw on windows.