fix build for mingw, and disable visual studio warnings