Bug 20722 - localtime_r and gmtime_r not present in mingw32
Summary: localtime_r and gmtime_r not present in mingw32
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-08 06:36 PDT by Luke Kenneth Casson Leighton
Modified: 2010-06-10 16:57 PDT (History)
1 user (show)

See Also:


Attachments
yuk! do not try this at home! (2.08 KB, patch)
2008-09-08 06:42 PDT, Luke Kenneth Casson Leighton
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Kenneth Casson Leighton 2008-09-08 06:36:57 PDT
$MY-CROSS-COMPILE-PREFIX/mingw32/include/time.h does not have localtime_r nor gmtime_r.

tor_localtime_r and a procedure for creating useable versions suitable for win32 is here:

http://archives.seul.org/or/cvs/Feb-2005/msg00222.html
Comment 1 Luke Kenneth Casson Leighton 2008-09-08 06:42:19 PDT
Created attachment 23254 [details]
yuk!  do not try this at home!

badly-hacked get-it-to-compile jobbie.
Comment 2 Mikkel Kruse Johnsen 2009-04-09 03:33:46 PDT
When will this patch go in, needed for compiling on mingw32.

I'm cross compiling on mingw32 on Fedora 10 and this is needed and it works.
Comment 3 Alexey Proskuryakov 2009-04-10 01:24:11 PDT
A patch originally described as "badly-hacked get-it-to-compile jobbie" needs to be reworked to have a chance of going in.
Comment 4 Luke Kenneth Casson Leighton 2009-04-10 03:52:06 PDT
(In reply to comment #3)
> A patch originally described as "badly-hacked get-it-to-compile jobbie" needs
> to be reworked to have a chance of going in.

:)

all it needs is someone else to review it, and come up with either a yes/no
or an alternative.

for example, why does Win32 native build succeed (or does it?)

does MSVC have localtime_r

does MingW32 _native_ have localtime_r ?

so - should this be #ifndef MINGW32 (or equiv) rather than #ifndef WIN32?

is the non-thread-safe version of localtime and gmtime acceptable to use?

should there be thread-locking around the use of localtime and gmtime?

is memcpy acceptable?

empirical evidence suggests that "yes" is the correct answer to the last
three of these questions.