mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-28 10:07:13 +02:00
Use AC_COMPILE_IFELSE for the monotonic clock test. (#362918, Han-Wen
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é)
This commit is contained in:
committed by
Matthias Clasen
parent
c9a28c0879
commit
505287cbae
@@ -1,3 +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é)
|
||||||
|
|
||||||
2006-12-15 Matthias Clasen <mclasen@redhat.com>
|
2006-12-15 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib/giochannel.h: Make ref_count a gint to avoid
|
* glib/giochannel.h: Make ref_count a gint to avoid
|
||||||
|
11
configure.in
11
configure.in
@@ -867,20 +867,17 @@ AC_CHECK_FUNCS(clock_gettime, [], [
|
|||||||
])
|
])
|
||||||
|
|
||||||
AC_CACHE_CHECK(for monotonic clocks,
|
AC_CACHE_CHECK(for monotonic clocks,
|
||||||
glib_cv_monotonic_clock,AC_TRY_RUN([
|
glib_cv_monotonic_clock,AC_COMPILE_IFELSE([
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
int main() {
|
int main() {
|
||||||
#if defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 && defined(CLOCK_MONOTONIC)
|
#if !(defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 && defined(CLOCK_MONOTONIC))
|
||||||
return 0;
|
#error No monotonic clock
|
||||||
#else
|
|
||||||
return 1;
|
|
||||||
#endif
|
#endif
|
||||||
|
return 0;
|
||||||
}],glib_cv_monotonic_clock=yes,glib_cv_monotonic_clock=no))
|
}],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
|
if test "$glib_cv_monotonic_clock" = "yes"; then
|
||||||
AC_DEFINE(HAVE_MONOTONIC_CLOCK,1,[Have a monotonic clock])
|
AC_DEFINE(HAVE_MONOTONIC_CLOCK,1,[Have a monotonic clock])
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user