added mingw compatibility