Joris van Rantwijk's fixes for cygwin (NB includes WIN32S_COMPAT)