From: Janne Blomqvist Date: Sat, 3 May 2014 20:56:26 +0000 (+0300) Subject: PR 56919 Check _POSIX_MONOTONIC_CLOCK. X-Git-Tag: releases/gcc-4.8.3~98 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f974a92421855c6ecb70307a7dff35c5a6a04cc2;p=thirdparty%2Fgcc.git PR 56919 Check _POSIX_MONOTONIC_CLOCK. 2014-05-03 Janne Blomqvist Backport from 4.9 PR libfortran/56919 * intrinsics/system_clock.c (GF_CLOCK_MONOTONIC): Check _POSIX_MONOTONIC_CLOCK as well. From-SVN: r210041 --- diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 9eb18d4d6a3e..dcdeac18347d 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,14 +1,20 @@ +2014-05-03 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-04-04 Bill Schmidt Backport from mainline 2013-11-15 Ulrich Weigand - * configure: Regenerate. 2014-03-15 Dominique d'Humieres diff --git a/libgfortran/intrinsics/system_clock.c b/libgfortran/intrinsics/system_clock.c index 87a87e22f1d3..63ea393f6a67 100644 --- a/libgfortran/intrinsics/system_clock.c +++ b/libgfortran/intrinsics/system_clock.c @@ -32,7 +32,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