There should be a check for whether localtime_r is present. If not then localtime_s should be used.
Created attachment 290012 [details] Patch This patch will search for localtime_r through CMake. If its there then it will attempt to use it. If its not there then it defaults to localtime_s which is a C++11 extension to time.h. The difference between the two seems to be that localtime_r is thread safe. If that's not a concern then maybe it should just be localtime_s across the board. MINGW appears to have the extension so I removed that. Windows still has its own localtime_s which reverses the parameters.
Comment on attachment 290012 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=290012&action=review > Source/WTF/wtf/DateMath.cpp:126 > +#if COMPILER(MSVC) This is inconsistent. In GregorianDateTime.cpp we only check HAVE(LOCALTIME_R) and here we check both. I think this check is unneeded.
In DateMath.cpp getLocalTime is called from calculateUTCOffset, calculateDSTOffset and calculateLocalTimeOffset. In the first two they are not called for Windows because there's an #if OS(WINDOWS) guard. In GregorianDateTime.cpp localtime is not called by Windows because of the #if OS(WINDOWS) guard. Any particular way you want this resolved? I could do another header that can be used from both files. Happy to approach it however you like.
Comment on attachment 290012 [details] Patch Clearing flags on attachment: 290012 Committed r206496: <http://trac.webkit.org/changeset/206496>
All reviewed patches have been landed. Closing bug.