summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Batard <pbatard@gmail.com>2010-01-16 22:45:00 +0000
committerPete Batard <pbatard@gmail.com>2010-01-16 22:45:00 +0000
commit2012ca7b23b2199022c51e84ca1d82838a9a570c (patch)
treefbd61e41d1dc79e1ea13abe6e442ef346b8ec3bf
parented6d3b36b8a9f27037956d1afe1d412d45ecc901 (diff)
downloadlibusb-2012ca7b23b2199022c51e84ca1d82838a9a570c.tar.gz
r88: final fix for MSVC/x64 (long in Windows' timeval struct)
-rw-r--r--libusb/os/windows_compat.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/libusb/os/windows_compat.h b/libusb/os/windows_compat.h
index 9159b4e..4eeb6e9 100644
--- a/libusb/os/windows_compat.h
+++ b/libusb/os/windows_compat.h
@@ -76,10 +76,11 @@ struct winfd fd_to_winfd(int fd);
struct winfd handle_to_winfd(HANDLE handle);
struct winfd overlapped_to_winfd(OVERLAPPED* overlapped);
+// On Windows, timeval (defined in WinSock.h) uses long for its members
#if !defined(TIMESPEC_TO_TIMEVAL)
-#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
-(tv)->tv_sec = (ts)->tv_sec; \
-(tv)->tv_usec = (ts)->tv_nsec / 1000; \
+#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
+ (tv)->tv_sec = (long)(ts)->tv_sec; \
+ (tv)->tv_usec = (long)(ts)->tv_nsec / 1000; \
}
#endif
#if !defined(timersub)