more mingw-w64 fixes, need to replace those long to int64 changes added in previous commit later with proper sizes i.e. int32 or so.