summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorChris Dickens <christopher.a.dickens@gmail.com>2017-01-12 11:01:59 -0800
committerChris Dickens <christopher.a.dickens@gmail.com>2017-01-12 15:03:16 -0800
commit068b59430679dd8c0d5e3ca812729fa7e734a12f (patch)
treed964351bc6d05dfc000d754ecc78239c8f438c49 /configure.ac
parent80f1657f063d17c751b9532c1f4e56e1c23e699f (diff)
downloadlibusb-068b59430679dd8c0d5e3ca812729fa7e734a12f.tar.gz
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>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac14
1 files changed, 4 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index 7b79517..49811a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -127,15 +127,10 @@ linux)
fi
AC_SUBST(USE_UDEV)
-case $is_backend_android in
-yes)
- dnl there are gettimeofday function but configure doesn't seem to be able to find it.
- AC_DEFINE([HAVE_GETTIMEOFDAY], [1], [Define if you have gettimeofday])
- ;;
-*)
- THREAD_CFLAGS="-pthread"
- LIBS="${LIBS} -pthread"
-esac
+ if test "x$is_backend_android" != xyes; then
+ THREAD_CFLAGS="-pthread"
+ LIBS="${LIBS} -pthread"
+ fi
AC_CHECK_HEADERS([poll.h])
AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument])
@@ -317,7 +312,6 @@ AM_CONDITIONAL([HAVE_SIGACTION], [test "x$have_sigaction" = "xyes"])
# headers not available on all platforms but required on others
AC_CHECK_HEADERS([sys/time.h])
-AC_CHECK_FUNCS(gettimeofday)
# check for -std=gnu99 compiler support
saved_cflags="$CFLAGS"