--- libusb-1.0.9/libusb/io.c +++ libusb-1.0.9-musl/libusb/io.c @@ -36,6 +36,17 @@ #include "libusbi.h" +/* + * Android and musl, at least, don't provide this macro + */ +#ifndef TIMESPEC_TO_TIMEVAL +#define TIMESPEC_TO_TIMEVAL(tv, ts) \ +do { \ + (tv)->tv_sec = (ts)->tv_sec; \ + (tv)->tv_usec = (ts)->tv_nsec / 1000; \ +} while (0) +#endif + /** * \page io Synchronous and asynchronous device I/O *