core: Split usbi_clock_gettime() into two separate functions

Most of the library only uses the monotonic clock. In fact, the only use
of the realtime clock is to implement the POSIX version of
usbi_cond_timedwait(). Now that Windows can no longer use the POSIX
thread abstraction, there is no need for Windows to implement a means of
reading the realtime clock.

This change replaces usbi_clock_gettime() with usbi_get_monotonic_time()
and usbi_get_real_time(). When clock_gettime() is available, both
functions are implemented as simple inline calls, otherwise the backend
must provide a definition for usbi_get_monotonic_time() *AND*
usbi_get_real_time() iff the platform is POSIX.

Reading the clocks is also never expected to fail. In practice, if it
ever did there would be much more than libusb that would not function
correctly. The new functions therefore have no return value, thus
allowing the callers to assume success and remove a bunch of error
handling code. The clock_gettime() wrappers have a simple error check
that is only enforced in debug builds.

This change also makes it unnecessary to check for and use
clock_gettime() on Windows, so remove it and always provide
usbi_get_monotonic_time().

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
10 files changed