improve windows build (mingw) support