From: Janne Blomqvist Date: Sat, 3 May 2014 21:03:10 +0000 (+0300) Subject: PR 56919 Check _POSIX_MONOTONIC_CLOCK. X-Git-Tag: releases/gcc-4.7.4~120 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1666ebd49b84ddbbd22cbf206d516345c3b09c45;p=thirdparty%2Fgcc.git PR 56919 Check _POSIX_MONOTONIC_CLOCK. 2014-05-04 Janne Blomqvist Backport from 4.9 PR libfortran/56919 * intrinsics/system_clock.c (GF_CLOCK_MONOTONIC): Check _POSIX_MONOTONIC_CLOCK as well. From-SVN: r210042 --- diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index dde1b58f69c3..514ff6216d45 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,8 +1,15 @@ +2014-05-04 Janne Blomqvist + + Backport from 4.9 + PR libfortran/56919 + * intrinsics/system_clock.c (GF_CLOCK_MONOTONIC): Check + _POSIX_MONOTONIC_CLOCK as well. + 2014-04-12 Jerry DeLisle Backport from mainline PR libfortran/60810 - io/unit.c (is_trim_ok): If internal unit is array, do not trim. + * io/unit.c (is_trim_ok): If internal unit is array, do not trim. 2014-03-15 Jerry DeLisle diff --git a/libgfortran/intrinsics/system_clock.c b/libgfortran/intrinsics/system_clock.c index 6385c4f0c95d..d4b2f850e55c 100644 --- a/libgfortran/intrinsics/system_clock.c +++ b/libgfortran/intrinsics/system_clock.c @@ -33,7 +33,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see /* POSIX states that CLOCK_REALTIME must be present if clock_gettime is available, others are optional. */ #if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_GETTIME_LIBRT) -#ifdef CLOCK_MONOTONIC +#if defined(CLOCK_MONOTONIC) && defined(_POSIX_MONOTONIC_CLOCK) \ + && _POSIX_MONOTONIC_CLOCK >= 0 #define GF_CLOCK_MONOTONIC CLOCK_MONOTONIC #else #define GF_CLOCK_MONOTONIC CLOCK_REALTIME