summaryrefslogtreecommitdiff
path: root/patches/libusb-timespec.diff
diff options
context:
space:
mode:
Diffstat (limited to 'patches/libusb-timespec.diff')
-rw-r--r--patches/libusb-timespec.diff18
1 files changed, 18 insertions, 0 deletions
diff --git a/patches/libusb-timespec.diff b/patches/libusb-timespec.diff
new file mode 100644
index 0000000..709daf0
--- /dev/null
+++ b/patches/libusb-timespec.diff
@@ -0,0 +1,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;