From 3dd6b0719cb1b8105377280758190d9def84ff3a Mon Sep 17 00:00:00 2001 From: Adam Hampson Date: Mon, 28 Jan 2013 18:35:11 -0800 Subject: Move TIMESPEC_TO_TIMEVAL definition Bionic's sys/time.h does not contain this definition so it is needed by both Windows and Android. Change-Id: I9bdbefca939f96528fe9ddb9e6c0d46663421562 Signed-off-by: Adam Hampson --- libusb/io.c | 7 +++++++ libusb/os/poll_windows.h | 6 ------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libusb/io.c b/libusb/io.c index e9bd312..0b876d1 100644 --- a/libusb/io.c +++ b/libusb/io.c @@ -1046,6 +1046,13 @@ printf("completed!\n"); * give up the events lock if instructed. */ +#if !defined(TIMESPEC_TO_TIMEVAL) +#define TIMESPEC_TO_TIMEVAL(tv, ts) { \ + (tv)->tv_sec = (long)(ts)->tv_sec; \ + (tv)->tv_usec = (long)(ts)->tv_nsec / 1000; \ +} +#endif + int usbi_io_init(struct libusb_context *ctx) { int r; diff --git a/libusb/os/poll_windows.h b/libusb/os/poll_windows.h index 6e5bf2b..e66c321 100644 --- a/libusb/os/poll_windows.h +++ b/libusb/os/poll_windows.h @@ -95,12 +95,6 @@ struct winfd overlapped_to_winfd(OVERLAPPED* overlapped); #include // defines timeval functions on DDK #endif -#if !defined(TIMESPEC_TO_TIMEVAL) -#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) #define timersub(a, b, result) \ do { \ -- cgit v1.2.3