fixes to make win32 version compile in mingw32