Use AC_COMPILE_IFELSE for the monotonic clock test. (#362918, Han-Wen
authorMatthias Clasen <mclasen@redhat.com>
Sat, 16 Dec 2006 22:11:23 +0000 (22:11 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sat, 16 Dec 2006 22:11:23 +0000 (22:11 +0000)
2006-12-16  Matthias Clasen  <mclasen@redhat.com>

        * configure.in: Use AC_COMPILE_IFELSE for the monotonic
        clock test.  (#362918, Han-Wen Nienhuys, Jeremy LainĂ©)

ChangeLog
configure.in

index 91171970df4ca677a8675d3841cffbb716815047..24ae24f2aab21c25a107ad88077131ae82613b67 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2006-12-16  Matthias Clasen  <mclasen@redhat.com>
 
+       * 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  <mclasen@redhat.com>
index 2de62880c3373bbe282c714471939af0eb56f1d8..2a063e7a271688b22f9efc397eda47249de5d370 100644 (file)
@@ -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 <time.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #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