if (cookie.yyHaveZone)
{
long delta;
- struct tm *gmt = gmtime (&Start);
+ struct tm *gmt;
+#ifdef HAVE_GMTIME_R
+ /* thread-safe version */
+ struct tm keeptime;
+ gmt = (struct tm *)gmtime_r(&Start, &keeptime);
+#else
+ gmt = gmtime(&Start);
+#endif
if (!gmt)
return -1;
delta = cookie.yyTimezone * 60L + difftm (&tm, gmt);
%expect 13
/* turn global variables into locals, additionally enable extra arguments
-** for yylex (pointer to yylval and use defined value)
+** for yylex (pointer to yylval and user defined value)
*/
%pure_parser
if (cookie.yyHaveZone)
{
long delta;
- struct tm *gmt = gmtime (&Start);
+ struct tm *gmt;
+#ifdef HAVE_GMTIME_R
+ /* thread-safe version */
+ struct tm keeptime;
+ gmt = (struct tm *)gmtime_r(&Start, &keeptime);
+#else
+ gmt = gmtime(&Start);
+#endif
if (!gmt)
return -1;
delta = cookie.yyTimezone * 60L + difftm (&tm, gmt);