diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-20 13:15:17 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-20 13:15:17 +0000 |
commit | c436f700b1bba68a8e85b5bc8c15561797a89cee (patch) | |
tree | 4fb430d6fc61a79d5b9eb441961b3c02f6bc0a4a /libgfortran/intrinsics | |
parent | c5d4a10b529a6cf299b7e6d87b5aa762ff147d56 (diff) | |
download | gcc-c436f700b1bba68a8e85b5bc8c15561797a89cee.tar.gz |
PR target/16135
* acinclude.m4 (LIBGFOR_TARGET_ILP32): New check.
* configure.ac: Include LIBGFOR_TARGET_ILP32.
* configure: Regenerate.
* config.h.in: Likewise.
* libgfortran.h: Provide default definitions for C99 types
on ILP32 targets that don't have them.
PR target/17999
* configure.ac: Check for snprintf.
* configure: Regenerate.
* config.h.in: Likewise.
* intrinsics/date_and_time.c (date_and_time): Do not
use snprinf if it is not available.
* io/write.c (output_float): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90964 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/intrinsics')
-rw-r--r-- | libgfortran/intrinsics/date_and_time.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libgfortran/intrinsics/date_and_time.c b/libgfortran/intrinsics/date_and_time.c index 63d18f5cb2d..e0b01234556 100644 --- a/libgfortran/intrinsics/date_and_time.c +++ b/libgfortran/intrinsics/date_and_time.c @@ -182,20 +182,35 @@ date_and_time (char *__date, if (__date) { +#if HAVE_SNPRINTF snprintf (date, DATE_LEN + 1, "%04d%02d%02d", values[0], values[1], values[2]); +#else + sprintf (date, "%04d%02d%02d", + values[0], values[1], values[2]); +#endif } if (__time) { +#if HAVE_SNPRINTF snprintf (timec, TIME_LEN + 1, "%02d%02d%02d.%03d", values[4], values[5], values[6], values[7]); +#else + sprintf (timec, "%02d%02d%02d.%03d", + values[4], values[5], values[6], values[7]); +#endif } if (__zone) { +#if HAVE_SNPRINTF snprintf (zone, ZONE_LEN + 1, "%+03d%02d", values[3] / 60, abs (values[3] % 60)); +#else + sprintf (zone, "%+03d%02d", + values[3] / 60, abs (values[3] % 60)); +#endif } #else /* if defined HAVE_NO_DATE_TIME */ /* We really have *nothing* to return, so return blanks and HUGE(0). */ |