Bug 7384 - DATE_AND_TIME milliseconds field inactive on Windows
DATE_AND_TIME milliseconds field inactive on Windows
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: libf2c
3.1.1
: P3 normal
: ---
Assigned To: Toon Moene
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2002-07-22 21:16 UTC by tprince
Modified: 2003-09-23 22:14 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
datetime.diff (1.05 KB, application/octet-stream)
2003-05-21 15:17 UTC, tprince
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tprince 2002-07-22 21:16:01 UTC
As the current source depends on gettimeofday() to supply the milliseconds field for DATE_AND_TIME(), it is left zero on Windows.  Programs which require this information must use a C wrapper to call the Windows API GetLocalTime().

Release:
gcc-3.1.1

Environment:
Windows 2K et al

How-To-Repeat:
Execute the u77-test.f program which is included in gcc-testsuite
Comment 1 tprince 2002-07-22 21:16:01 UTC
Fix:
Apply the attached patch to libf2c/libU77/datetime_.c, arrange that _WIN32 is pre-defined by gcc for the build of this directory (e.g. by including -mwin32 in CFLAGS when building under cygwin).  Note that [de]time_.c also look for _WIN32 to be pre-defined.
Comment 2 Toon Moene 2002-09-14 05:52:46 UTC
Responsible-Changed-From-To: unassigned->toon
Responsible-Changed-Why: Fortran Maintainer.
Comment 3 Toon Moene 2002-09-14 05:52:46 UTC
State-Changed-From-To: open->feedback
State-Changed-Why: I (Toon Moene) installed your patch - it survived bootstrap
    and make check on powerpc-unknown-linux-gnu.
    
    Could you please check whether it actually fixes this PR ?
    
    Thanks.
Comment 4 Toon Moene 2002-09-17 14:29:58 UTC
State-Changed-From-To: feedback->closed
State-Changed-Why: Fixed according to submitter - by the patch he supplied
    in this bug report.