Bug 25806 - gmtime_s and localtime_s are Microsoft extensions that don't exist in MSVC < 2005
Summary: gmtime_s and localtime_s are Microsoft extensions that don't exist in MSVC < ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-14 14:22 PDT by Fridrich Strba
Modified: 2009-05-25 08:48 PDT (History)
1 user (show)

See Also:


Attachments
cater for older MS compilers and for GCC that does not have localtime_s and gmtime_s (1.11 KB, patch)
2009-05-14 14:23 PDT, Fridrich Strba
no flags Details | Formatted Diff | Diff
Clean proper standard-compliant patch with a proper clean ChangeLog entry (1.91 KB, patch)
2009-05-15 01:25 PDT, Fridrich Strba
mrowe: review-
Details | Formatted Diff | Diff
This patch even has the proper e-mail address and spaces instead of tabs (1.93 KB, patch)
2009-05-15 01:34 PDT, Fridrich Strba
no flags Details | Formatted Diff | Diff
And now the patch also does what it pretends (1.93 KB, patch)
2009-05-15 01:36 PDT, Fridrich Strba
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fridrich Strba 2009-05-14 14:22:01 PDT
gmtime_s and localtime_s are Microsoft extensions that appeared in Visual Studio 2005 (aka Version 8.0). gmtime and localtime are already thread safe in MicroSoft C library, so following patch makes it possible to build with Mingw and eventually with Visual Studio 7.1 or lower.
Comment 1 Fridrich Strba 2009-05-14 14:23:46 PDT
Created attachment 30356 [details]
cater for older MS compilers and for GCC that does not have localtime_s and gmtime_s
Comment 2 Fridrich Strba 2009-05-15 01:25:05 PDT
Created attachment 30372 [details]
Clean proper standard-compliant patch with a proper clean ChangeLog entry
Comment 3 Mark Rowe (bdash) 2009-05-15 01:32:06 PDT
Comment on attachment 30372 [details]
Clean proper standard-compliant patch with a proper clean ChangeLog entry

The ChangeLog entry has tabs in it, and lacks an email address.  As best I can make out, the patch doesn’t do what the ChangeLog describes either.  It uses localtime_s on older versions of MSVC, and uses localtime on newer versions.  That doesn’t fit with the ChangeLog saying that localtime_s doesn’t exist on older versions.
Comment 4 Fridrich Strba 2009-05-15 01:34:54 PDT
Created attachment 30373 [details]
This patch even has the proper e-mail address and spaces instead of tabs
Comment 5 Fridrich Strba 2009-05-15 01:36:53 PDT
Created attachment 30374 [details]
And now the patch also does what it pretends
Comment 6 Maciej Stachowiak 2009-05-22 00:35:32 PDT
Comment on attachment 30374 [details]
And now the patch also does what it pretends

Looks good. r=me
Comment 7 Xan Lopez 2009-05-25 08:48:55 PDT
Landed as r44130.