fix bug in date->time-utc caused by incorrect use of difftime in Windows

original commit: 4748dad50c7f0e9b3ba002c27990d4c88c0189fc
This commit is contained in:
Bob Burger 2017-12-29 18:19:09 -03:00
parent 228a22ad84
commit 350f87ba4d
4 changed files with 17 additions and 5 deletions

2
LOG
View File

@ -772,3 +772,5 @@
main.c
- fix even? and odd? to error on exceptional flonums
5_3.ss, 5_3.ms, fl.ms, root-experr*, patch*
- fix bug in date->time-utc caused by incorrect use of difftime in Windows
stats.c, date.ms, release_notes.stex

View File

@ -409,7 +409,7 @@ ptr S_mktime(ptr dtvec) {
tzoff = adjust_time_zone(dtvec, &tmx, given_tzoff);
if (tzoff != orig_tzoff) tx = (time_t) difftime(tx, (time_t)(orig_tzoff - tzoff));
if (tzoff != orig_tzoff) tx = tx - orig_tzoff + tzoff;
return Scons(S_integer_time_t(tx), Svector_ref(dtvec, dtvec_nsec));
}

View File

@ -622,9 +622,11 @@
(sleep (make-time 'time-duration 0 1))
(time<? t (date->time-utc (current-date))))
(let ([t (current-time)])
(time=?
(date->time-utc (time-utc->date t -14400))
(date->time-utc (time-utc->date t 0))))
(and
(time=? (date->time-utc (time-utc->date t)) t)
(time=? (date->time-utc (time-utc->date t -86400)) t)
(time=? (date->time-utc (time-utc->date t 0)) t)
(time=? (date->time-utc (time-utc->date t 86400)) t)))
)
(mat time&date-printing

View File

@ -1535,6 +1535,14 @@ in fasl files does not generally make sense.
%-----------------------------------------------------------------------------
\section{Bug Fixes}\label{section:bugfixes}
\subsection{Incorrect handling of offset in
\protect\scheme{date->time-utc} on Windows (9.5)}
A bug when \scheme{date->time-utc} is called on Windows with a
date-zone-offset smaller than the system's time-zone offset has been
fixed.
[This bug dated back to Version 9.5.]
\subsection{Compiler mishandling of fx /carry operations (9.5)}
A bug in the source optimizer that caused an internal compiler error when