fixed compiling on mingw