diff options
author | Rosen Penev <rosenp@gmail.com> | 2022-06-12 22:22:39 -0700 |
---|---|---|
committer | Tormod Volden <debian.tormod@gmail.com> | 2022-06-26 17:09:14 +0200 |
commit | 5691f303ad272a2514f68a96d6c18aeff62eb33d (patch) | |
tree | 8eaca9a9cee5d14c39e10c38a60f2601b9bc195f | |
parent | fa9a25b3c47420fe4fbafea83b865516b1f10aea (diff) | |
download | libusb-5691f303ad272a2514f68a96d6c18aeff62eb33d.tar.gz |
windows: Add clock_gettime check
Under MSYS2, the windows usbi_get_monotonic_time interferes with the
static inline function under libusbi.h
Closes #1151
-rw-r--r-- | libusb/os/windows_common.c | 2 | ||||
-rw-r--r-- | libusb/version_nano.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/libusb/os/windows_common.c b/libusb/os/windows_common.c index 24ac095..1f4b683 100644 --- a/libusb/os/windows_common.c +++ b/libusb/os/windows_common.c @@ -848,6 +848,7 @@ static int windows_handle_transfer_completion(struct usbi_transfer *itransfer) return usbi_handle_transfer_completion(itransfer, status); } +#ifndef HAVE_CLOCK_GETTIME void usbi_get_monotonic_time(struct timespec *tp) { static LONG hires_counter_init; @@ -872,6 +873,7 @@ void usbi_get_monotonic_time(struct timespec *tp) tp->tv_sec = (long)(hires_counter.QuadPart / hires_frequency); tp->tv_nsec = (long)(((hires_counter.QuadPart % hires_frequency) * hires_ticks_to_ps) / UINT64_C(1000)); } +#endif // NB: MSVC6 does not support named initializers. const struct usbi_os_backend usbi_backend = { diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 045fb83..35ee140 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 11730 +#define LIBUSB_NANO 11731 |