From d4dc24fc1bd987172bbf2f47f03e985c94ac0399 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 16 Dec 2006 22:11:23 +0000 Subject: [PATCH] Use AC_COMPILE_IFELSE for the monotonic clock test. (#362918, Han-Wen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2006-12-16 Matthias Clasen * configure.in: Use AC_COMPILE_IFELSE for the monotonic clock test. (#362918, Han-Wen Nienhuys, Jeremy Lainé) --- ChangeLog | 3 +++ configure.in | 11 ++++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 91171970d..24ae24f2a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2006-12-16 Matthias Clasen + * configure.in: Use AC_COMPILE_IFELSE for the monotonic + clock test. (#362918, Han-Wen Nienhuys, Jeremy Lainé) + * glib/gstring.c: Move documentation inline. 2006-12-15 Matthias Clasen diff --git a/configure.in b/configure.in index 2de62880c..2a063e7a2 100644 --- a/configure.in +++ b/configure.in @@ -867,20 +867,17 @@ AC_CHECK_FUNCS(clock_gettime, [], [ ]) AC_CACHE_CHECK(for monotonic clocks, - glib_cv_monotonic_clock,AC_TRY_RUN([ + glib_cv_monotonic_clock,AC_COMPILE_IFELSE([ #include #ifdef HAVE_UNISTD_H #include #endif int main() { -#if defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 && defined(CLOCK_MONOTONIC) - return 0; -#else - return 1; +#if !(defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 && defined(CLOCK_MONOTONIC)) + #error No monotonic clock #endif + return 0; }],glib_cv_monotonic_clock=yes,glib_cv_monotonic_clock=no)) - -GLIB_ASSERT_SET(glib_cv_monotonic_clock) if test "$glib_cv_monotonic_clock" = "yes"; then AC_DEFINE(HAVE_MONOTONIC_CLOCK,1,[Have a monotonic clock]) fi