Attached a fixed and tested (cygwin, solaris) patch. Regards, Michele
On Wed, May 7, 2014 at 4:46 PM, John Cowan <co...@mercury.ccil.org> wrote: > Peter Bex scripsit: > >> In my opinion, large parts of the POSIX unit should die. They're broken, >> at the wrong level of abstraction and just generally unschemely. The >> reason these time things are breaking is because the libc time access >> is so varying across operating systems. > > In this case, it's a plain implementation failure: the simulation for > tm_gmtoff on non-GNU/BSD systems is broken. Here's a patch: > > --- runtime.c.orig 2014-05-07 10:19:44.108430900 -0400 > +++ runtime.c 2014-05-07 10:21:11.024402300 -0400 > @@ -8180,9 +8180,9 @@ > /* negative for west of UTC, but we want positive */ > C_fix(-tmt->tm_gmtoff) > #elif defined(__CYGWIN__) || defined(__MINGW32__) || defined(_WIN32) || > defined(__WINNT__) > - C_fix(mode == C_SCHEME_FALSE ? _timezone : 0) /* does not > account for DST */ > + C_fix(mode == C_SCHEME_FALSE ? _timezone - _daylight * > 3600 : 0) > #else > - C_fix(mode == C_SCHEME_FALSE ? timezone : 0) /* does not > account for DST */ > + C_fix(mode == C_SCHEME_FALSE ? timezone - daylight * 3600 > : 0) > #endif > ); > C_kontinue(k, info); > > > I don't know why whoever wrote this simply added a comment saying DST > was not taken into account instead of taking it into account. Actually, > avoiding tm_gmtoff altogether would be more portable. > > -- > John Cowan http://www.ccil.org/~cowan co...@ccil.org > But that, he realized, was a foolish thought; as no one knew better than > he that the Wall had no other side. > --Arthur C. Clarke, "The Wall of Darkness"
0001-fix-timezone-offset-on-platforms-with-no-tm_gmtoff.patch
Description: Binary data
_______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users