added ifdefs for win32 support