Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
#define CONFIG_PRINTF_RNDN
#endif

#if defined(__NEWLIB__)
#define NO_TM_GMTOFF
#endif

/* dump object free */
//#define DUMP_FREE
//#define DUMP_CLOSURE
Expand Down Expand Up @@ -40524,7 +40528,17 @@ static int getTimezoneOffset(int64_t time) {
}
ti = time;
localtime_r(&ti, &tm);
#ifdef NO_TM_GMTOFF
struct tm gmt;
gmtime_r(&ti, &gmt);

/* disable DST adjustment on the local tm struct */
tm.tm_isdst = 0;

return difftime(mktime(&gmt), mktime(&tm)) / 60;
#else
return -tm.tm_gmtoff / 60;
#endif /* NO_TM_GMTOFF */
#endif
}

Expand Down