X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Ftime.c;h=4b4cf9c21c5a6c35cbcdbff6925b695041c40dd3;hb=2b90fd1dbad23322258222a2ef4cef7f6a00831d;hp=402a19f1aad7abda4a1771aa923bb672306089e2;hpb=ebc0f0ebf9efd39519ab86ba28c33abdb25443e0;p=sbcl.git diff --git a/src/runtime/time.c b/src/runtime/time.c index 402a19f..4b4cf9c 100644 --- a/src/runtime/time.c +++ b/src/runtime/time.c @@ -23,8 +23,17 @@ void get_timezone(time_t when, int *secwest, boolean *dst) struct tm ltm, gtm; int sw; +#ifdef LISP_FEATURE_WIN32 + /* 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. */ + ltm = *localtime(&when); + gtm = *gmtime(&when); +#else ltm = *localtime_r(&when, <m); gtm = *gmtime_r(&when, >m); +#endif sw = (((gtm.tm_hour*60)+gtm.tm_min)*60+gtm.tm_sec) - (((ltm.tm_hour*60)+ltm.tm_min)*60+ltm.tm_sec); if ((gtm.tm_wday + 1) % 7 == ltm.tm_wday)