aboutsummaryrefslogtreecommitdiffstats
path: root/main/libusbx/define-timespec-to-timeinterval.patch
blob: 3a276bc4c98b0f87e89fa542ab55aa65c4ca852f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--- libusbx-1.0.17.orig/libusb/io.c
+++ libusbx-1.0.17/libusb/io.c
@@ -38,6 +38,14 @@
 #include "libusbi.h"
 #include "hotplug.h"
 
+#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
  *