--- libev/ev_win32.c 2013/06/10 00:14:23 1.16 +++ libev/ev_win32.c 2019/07/11 05:41:39 1.19 @@ -39,9 +39,6 @@ #ifdef _WIN32 -/* timeb.h is actually xsi legacy functionality */ -#include - /* note: the comment below could not be substantiated, but what would I care */ /* MSDN says this is required to handle SIGFPE */ /* my wild guess would be that using something floating-pointy is required */ @@ -91,6 +88,8 @@ if (connect (sock [0], (struct sockaddr *)&addr, addr_size)) goto fail; + /* TODO: returns INVALID_SOCKET on winsock accept, not < 0. fix it */ + /* when convenient, probably by just removing error checking altogether? */ if ((sock [1] = accept (listener, 0, 0)) < 0) goto fail; @@ -155,8 +154,8 @@ ui.u.LowPart = ft.dwLowDateTime; ui.u.HighPart = ft.dwHighDateTime; - /* msvc cannot convert ulonglong to double... yes, it is that sucky */ - return (LONGLONG)(ui.QuadPart - 116444736000000000) * 1e-7; + /* also, msvc cannot convert ulonglong to double... yes, it is that sucky */ + return EV_TS_FROM_US (((LONGLONG)(ui.QuadPart - 116444736000000000) * 1e-1)) } #endif