summaryrefslogtreecommitdiff
path: root/patches/libusb-timespec.diff
blob: 709daf08a4f69a3106f467e158f112f2d411b1d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--- work/libusb-1.0.9-orig/libusb/io.c	2014-09-14 23:33:05.286816058 +0200
+++ work/libusb-1.0.9/libusb/io.c	2014-09-14 23:35:13.255450621 +0200
@@ -1046,6 +1046,15 @@
  * give up the events lock if instructed.
  */
 
+/* Android workaround */
+#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 /* end of TIMESPEC_TO_TIMEVAL */
+
 int usbi_io_init(struct libusb_context *ctx)
 {
 	int r;