#ifndef HAS_LOCALTIME_R
/* Simulate localtime_r() to the best of our ability */
static struct tm * S_localtime_r(const time_t *clock, struct tm *result) {
+#ifdef VMS
dTHX; /* in case the following is defined as Perl_my_localtime(aTHX_ ...) */
+#endif
const struct tm *static_result = localtime(clock);
assert(result != NULL);
/* GMT is Jan 1st, xx01 year, but localtime is still Dec 31st
in a non-leap xx00. There is one point in the cycle
we can't account for which the safe xx00 year is a leap
- year. So we need to correct for Dec 31st comming out as
+ year. So we need to correct for Dec 31st coming out as
the 366th day of the year.
*/
if( !IS_LEAP(local_tm->tm_year) && local_tm->tm_yday == 365 )