diff options
author | Pete Batard <pbatard@gmail.com> | 2010-01-21 02:55:30 +0000 |
---|---|---|
committer | Pete Batard <pbatard@gmail.com> | 2010-01-21 02:55:30 +0000 |
commit | 3fa6b35e7e89f48749bf0d05d4d03e7ffe51f431 (patch) | |
tree | 7ae3a5fc5837ddefa54193408f0740a117fb19a5 /libusb/os/windows_compat.h | |
parent | 0c568de2e355ade7ba1965437e9dc9d6459eed5c (diff) | |
download | libusb-3fa6b35e7e89f48749bf0d05d4d03e7ffe51f431.tar.gz |
r96: added sources support (Orin Eman)
Diffstat (limited to 'libusb/os/windows_compat.h')
-rw-r--r-- | libusb/os/windows_compat.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libusb/os/windows_compat.h b/libusb/os/windows_compat.h index 689b82a..8cae332 100644 --- a/libusb/os/windows_compat.h +++ b/libusb/os/windows_compat.h @@ -78,6 +78,31 @@ 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 + +/* + * Structure used in select() call, taken from the BSD file sys/time.h. + */ +#if defined(DDKBUILD) +struct timeval { + long tv_sec; /* seconds */ + long tv_usec; /* and microseconds */ +}; +#endif + +#if !defined(timerisset) +#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) +#endif + +#if !defined(timercmp) +#define timercmp(tvp, uvp, cmp) \ + ((tvp)->tv_sec cmp (uvp)->tv_sec || \ + (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec) +#endif + +#if !defined(timerclr) +#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 +#endif + #if !defined(TIMESPEC_TO_TIMEVAL) #define TIMESPEC_TO_TIMEVAL(tv, ts) { \ (tv)->tv_sec = (long)(ts)->tv_sec; \ |