[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libvirt] [PATCH libvirt 6/6] Cast timeval.tv_sec long to localtime
Re: [libvirt] [PATCH libvirt 6/6] Cast timeval.tv_sec long to localtime expected type time_t
Sat, 28 Jan 2012 03:51:40 +0100
KMail/4.7.4 (Linux/3.1.0-1.2-desktop; KDE/4.7.4; x86_64; ; )
Marc-André Lureau wrote:
> >>> Oops. struct timeval is generating a struct timeval with a 32-bit
> >>> tv_sec even when time_t is 64-bits.
> Mingw64 reviewer said Windows actually defines it. I dig the msdn and
> found this:
> I suppose they are correct, and they should follow what Windows uses.
> The problem was reported in an msdn discussion too:
Thanks for the deeper investigation. Indeed, 'struct timeval' is defined
by the Winsock2 API, and used by the functions GetAddrInfoEx, SetAddrInfoEx,
WSAConnectByList, WSAConnectByName, select. mingw64 cannot easily change
> Should gnulib redefine this struct similarly to other incompatible types?
Yes, this will make sense. As far as I can see, it's a manageable task:
Only the replacements of <sys/time.h>, <sys/select.h>, select(),
gettimeofday(), getsockopt(), setsockopt() will need work.