make it work on win32 and linux