monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] strptime not in MinGW time.h


From: Thomas Keller
Subject: Re: [Monotone-devel] strptime not in MinGW time.h
Date: Fri, 21 May 2010 11:32:29 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.9) Gecko/20100317 SUSE/3.0.4-1.1.1 Lightning/1.0b2pre Thunderbird/3.0.4

Am 21.05.2010 11:24, schrieb Stephen Leake:
> Derek Scherger <address@hidden> writes:
>>> Perhaps we could simply say "user-configurable date formats not
>>> available on Win32". I'm ok with that.
>>
>> Or "editing the Date: header is unsupported on Win32"
> 
> Ok, I'll see if I can make this work. Then we can release, and come up
> with a better solution later.
> 
> One option would be to find Microsoft's date parsing function (there
> must be one somewhere) and use a platform.hh wrapper. I tried searching
> for "parse date" on MSDN, and got over 1,000 hits; the first couple of
> pages were all in .NET or Visual Basic or some other high level layer.
> There does not seem to be a way to restrict the search to "plain C API"!
> So I gave up.
> 
> Anticipating that, and as a clean way to avoid the compilation error,
> I'll add a wrapper "parse_date" in platform.hh now, making it take the
> same parameters as strptime. The Win32 version will throw an error. Hmm.
> Maybe it needs to support only a "standard" format instead?
> 
> I'll also see if this compiles on Cygwin. Has anyone compiled on Mac
> since the changelog editor landed?

Yes, continuously :) No problems there.

> Hmm. I just did some wider web searching, and found this:
> 
> http://stackoverflow.com/questions/234171/parse-a-date-from-a-string-in-win32
> 
> Apparently Win32 can convert a SystemTime struct to a formatted string,
> but cannot then parse the string. Which explains why every higher-level
> package has its own way of parsing dates. Wonderfull.
> 
> Boost has a Date_Time library, but I suspect we don't want to go there.

I think its sufficient to disable the date format changing on win32 for
now and trigger a warning if the original entered value has been changed
by the user to a value our date parsing infrastructure cannot
understand. This is better than disabling it completly on win32 and if
somebody cares he / she can contribute the work to include strptime into
monotone as suggested earlier to make it fully work.

Thomas.

-- 
GPG-Key 0x160D1092 | address@hidden | http://thomaskeller.biz
Please note that according to the EU law on data retention, information
on every electronic information exchange might be retained for a period
of six months or longer: http://www.vorratsdatenspeicherung.de/?lang=en


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]