From 8a5545de25d243955c68fb8d6c1bd9ef856b8e8a Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 17 Jul 2017 21:08:15 +0200 Subject: utils: Use autoconf to check for availability of clock_gettime() --- configure.ac | 2 +- src/utils.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 5e8fad7..b836f45 100644 --- a/configure.ac +++ b/configure.ac @@ -96,7 +96,7 @@ AC_TYPE_UINT8_T AC_FUNC_MALLOC AC_FUNC_REALLOC AC_CHECK_FUNCS([strcasecmp strdup strerror strndup stpcpy]) -AC_CHECK_FUNCS([ppoll]) +AC_CHECK_FUNCS([ppoll clock_gettime]) # Check for operating system AC_MSG_CHECKING([whether to enable WIN32 build settings]) diff --git a/src/utils.c b/src/utils.c index 67860b3..28664d4 100644 --- a/src/utils.c +++ b/src/utils.c @@ -302,7 +302,7 @@ int plist_write_to_filename(plist_t plist, const char *filename, enum plist_form return 1; } -#ifdef __APPLE__ +#ifndef HAVE_CLOCK_GETTIME typedef int clockid_t; #define CLOCK_MONOTONIC 1 -- cgit v1.1-32-gdbae