aboutsummaryrefslogtreecommitdiff
path: root/libf2c/libU77/datetime_.c
diff options
context:
space:
mode:
authorMumit Khan <khan@xraylith.wisc.edu>1999-04-11 22:35:17 +0000
committerJeffrey A Law <law@cygnus.com>1999-04-11 22:35:17 +0000
commit9767031531a8119f197ac0a0b1322670270f967c (patch)
treedd16fac232282ee1ffae2ddc2ed25b4eaec02499 /libf2c/libU77/datetime_.c
parent54d43df0121727a49f077c1e6b72649733b75150 (diff)
* libU77/aclocal.m4: New file.
* libU77/configure.in (LIBU77_HAVE_STRUCT_TIMEZONE): Add test. * libU77/acconfig.h (HAVE_STRUCT_TIMEZONE): Add macro. * libU77/datetime_c.c (G77_date_and_time_0): Use. * libU77/config.hin: Regenerate. * libU77/configure: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@26353 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libf2c/libU77/datetime_.c')
-rw-r--r--libf2c/libU77/datetime_.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libf2c/libU77/datetime_.c b/libf2c/libU77/datetime_.c
index 35f0d1cdf74..faf773a944c 100644
--- a/libf2c/libU77/datetime_.c
+++ b/libf2c/libU77/datetime_.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of GNU Fortran libU77 library.
This library is free software; you can redistribute it and/or modify it
@@ -62,8 +62,16 @@ int G77_date_and_time_0 (char *date, char *fftime, char *zone,
#if HAVE_GETTIMEOFDAY
{
struct timeval tp;
+#if HAVE_STRUCT_TIMEZONE
struct timezone tzp;
+ /* This is still not strictly correct on some systems such as HPUX,
+ which does have struct timezone, but gettimeofday takes void* as
+ the 2nd arg. However, the effect of passing anything other than a null
+ pointer is unspecified on HPUX. */
if (! gettimeofday (&tp, &tzp))
+#else
+ if (! gettimeofday (&tp, (void *) 0))
+#endif
vals[7] = tp.tv_usec/1000;
}
#endif