X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Ftime.c;h=7b4b167e7a825b0a7cc1703db54bc97b0c662dce;hb=b83353d9f998e5c0e34604b5593df70c66d2c510;hp=4b4cf9c21c5a6c35cbcdbff6925b695041c40dd3;hpb=2561033fd3ed9e224dffc445262e097e5abfa920;p=sbcl.git diff --git a/src/runtime/time.c b/src/runtime/time.c index 4b4cf9c..7b4b167 100644 --- a/src/runtime/time.c +++ b/src/runtime/time.c @@ -18,6 +18,11 @@ #include "sbcl.h" #include "runtime.h" +#ifdef LISP_FEATURE_HPUX +struct tm *gmtime_r(const time_t *timer, struct tm *result); +struct tm *localtime_r(const time_t *timer, struct tm *result); +#endif + void get_timezone(time_t when, int *secwest, boolean *dst) { struct tm ltm, gtm; @@ -27,7 +32,12 @@ void get_timezone(time_t when, int *secwest, boolean *dst) /* No _r versions on Windows, but the API documentation also * doesn't warn them about being non-reentrant... So here's * hoping they actually are -- once Windows grows threads - * this better be checked, though. */ + * this better be checked, though. + * + * The Windows versions also don't support times before the + * epoch, so we kludge it. */ + if (when < 0) + when = 0; ltm = *localtime(&when); gtm = *gmtime(&when); #else