core: Remove use of gettimeofday()
authorChris Dickens <christopher.a.dickens@gmail.com>
Thu, 12 Jan 2017 19:01:59 +0000 (11:01 -0800)
committerChris Dickens <christopher.a.dickens@gmail.com>
Thu, 12 Jan 2017 23:03:16 +0000 (15:03 -0800)
commit068b59430679dd8c0d5e3ca812729fa7e734a12f
treed964351bc6d05dfc000d754ecc78239c8f438c49
parent80f1657f063d17c751b9532c1f4e56e1c23e699f
core: Remove use of gettimeofday()

Prior to this commit, gettimeofday() was being used for timestamps
in debug messages. This function has been marked as deprecated in
the latest POSIX specification and furthermore is not supported on
Windows, thus requiring our own implementation as usbi_gettimeofday().

This commit changes the logging code to obtain timestamps using the
clock_gettime() function provided by the backend. The implementation of
usbi_gettimeofday() for Windows was actually equivalent to that of the
USBI_CLOCK_REALTIME implementation for clock_gettime(), so this
eliminates code duplication. In addition, the USBI_CLOCK_REALTIME
implementation has been updated for Windows to leverage the
timespec_get() function available in VS 2015 and later.

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Xcode/config.h
android/config.h
configure.ac
libusb/core.c
libusb/libusbi.h
libusb/os/wince_usb.c
libusb/os/windows_common.h
libusb/os/windows_nt_common.c
libusb/version_nano.h