made some changes for compilation on Cygwin