diff options
author | toon <toon@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-09-14 12:50:40 +0000 |
---|---|---|
committer | toon <toon@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-09-14 12:50:40 +0000 |
commit | 6196add79cffa043f4c84a1255761842c7a638f3 (patch) | |
tree | 9a9ac25c7f29bb5c53fdd58373422233e975a880 /libf2c | |
parent | dfcd44254fafbc35acb2bdafb04b5531d743a934 (diff) | |
download | gcc-6196add79cffa043f4c84a1255761842c7a638f3.tar.gz |
2002-09-14 Tim Prince <tprince@computer.org>
PR libf2c/7384
* libU77/datetime_.c: Use GetLocalTime on MS-Windows.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57142 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libf2c')
-rw-r--r-- | libf2c/ChangeLog | 5 | ||||
-rw-r--r-- | libf2c/libU77/datetime_.c | 15 |
2 files changed, 18 insertions, 2 deletions
diff --git a/libf2c/ChangeLog b/libf2c/ChangeLog index 6627427edec..87ce8282369 100644 --- a/libf2c/ChangeLog +++ b/libf2c/ChangeLog @@ -1,3 +1,8 @@ +2002-09-14 Tim Prince <tprince@computer.org> + + PR libf2c/7384 + * libU77/datetime_.c: Use GetLocalTime on MS-Windows. + 2002-08-31 Toon Moene <toon@moene.indiv.nluug.nl> PR fortran/6367 diff --git a/libf2c/libU77/datetime_.c b/libf2c/libU77/datetime_.c index 40786ed8e6d..cd7c7ca0a3b 100644 --- a/libf2c/libU77/datetime_.c +++ b/libf2c/libU77/datetime_.c @@ -31,6 +31,11 @@ Boston, MA 02111-1307, USA. */ # include <time.h> # endif #endif +#if defined (_WIN32) +#include <windows.h> +#undef min +#undef max +#endif #include "f2c.h" void s_copy (register char *a, register char *b, ftnlen la, ftnlen lb); @@ -44,6 +49,14 @@ G77_date_and_time_0 (char *date, char *fftime, char *zone, struct tm ltime = *localtime (<), gtime = *gmtime (<); char dat[9], zon[6], ftim[11]; int i, vals[8]; +#if defined (_WIN32) + struct _SYSTEMTIME wdattim; + GetLocalTime(&wdattim); + vals[7] = wdattim.wMilliseconds; +#else + vals[7] = 0; /* no STDC/POSIX way to get this */ + /* GNUish way; maybe use `ftime' on other systems. */ +#endif vals[0] = 1900 + ltime.tm_year; vals[1] = 1 + ltime.tm_mon; @@ -55,8 +68,6 @@ G77_date_and_time_0 (char *date, char *fftime, char *zone, vals[4] = ltime.tm_hour; vals[5] = ltime.tm_min; vals[6] = ltime.tm_sec; - vals[7] = 0; /* no STDC/POSIX way to get this */ - /* GNUish way; maybe use `ftime' on other systems. */ #if HAVE_GETTIMEOFDAY { struct timeval tp; |