replace gnulib with mingw functions