[webkit-reviews] datetime_object Win32 patch

Maciej Stachowiak mjs at apple.com
Mon Jun 13 02:41:10 PDT 2005


On Jun 10, 2005, at 3:52 PM, Justin Haygood wrote:

> Patch is at http://bugzilla.opendarwin.org/show_bug.cgi?id=3372
>
> It includes a patch and (sadly) new files needed to implement. If  
> you know of an existing place I can merge those files into, let me  
> know.
>
> Changelog:
>
> Win32 follows the BSD syntax for _timezone and _daytime, so it uses  
> that.
>
> wincommon.h includes and define things needed for proper usage.
>
> wintime.h includes and contains prototypes for implementations of  
> timegm() and gettimeofday() for Win32, and includes winsock2.h,  
> which has an implementation for the timeval struct.
>
> wintime.cpp contains BSD licensed implementations of timegm() and  
> gettimeofday(). Well, LGPL now since I put the names of the  
> original creators in the copyright area, so i "gave credit where  
> credit is due" to comply with the license.
>

I read over this patch, and generally it looks good. However, I think  
you can avoid the copy of gettimeofday, just by making sure  
HAVE_SYS_TIMEB_H is defined on Windows. That will fall into another  
case in the #if chain that will use _ftime, which should be defined  
on windows (I found this out from Harri Porten who apparently ported  
kjs to windows quite some time ago).

I think we'll have to add timegm for now, but it looks like TOT kjs  
in KDE doesn't use timegm at all, so we may be able to eliminate that  
once we merge more of their fixes.

Please send another patch that does the _ftime thing instead of  
gettimeofday.

Regards,
Maciej




More information about the webkit-reviews mailing list