This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [patch] Default to --enable-libstdcxx-time=auto
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Steve Ellcey <sellcey at imgtec dot com>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>, Benjamin Kosnik <bkoz at redhat dot com>
- Date: Tue, 28 May 2013 18:46:37 +0100
- Subject: Re: [patch] Default to --enable-libstdcxx-time=auto
- References: <CAH6eHdTgTspzbfHhD3uDwDVD3uXAapb_NMZ0jAZ-4-UjfD4H4g at mail dot gmail dot com> <1369757459 dot 12204 dot 4 dot camel at ubuntu-sellcey> <CAH6eHdS7fLwa+GV1Eteu9muOnuETwM6xB3KMyk3HG0ZUuHbO7w at mail dot gmail dot com> <1369762783 dot 12204 dot 17 dot camel at ubuntu-sellcey>
On 28 May 2013 18:39, Steve Ellcey wrote:
> On Tue, 2013-05-28 at 17:29 +0100, Jonathan Wakely wrote:
>
>>
>> I don't think it was my patch that broke it, because
>> compatibility-chrono.cc didn't exist when my patch went in :-)
>
> Sorry about that, I guess I got lost in a maze of twisty checkins.
Well the later checkins were Jakub and Benjamin fixing the unexpected
fallout from my one, so it was all related.
>> Does this help?
>>
>> --- src/c++11/compatibility-chrono.cc.orig 2013-05-28
>> 17:27:54.631919423 +0100
>> +++ src/c++11/compatibility-chrono.cc 2013-05-28 17:28:43.697861786 +0100
>> @@ -78,7 +78,9 @@
>> + chrono::microseconds(tv.tv_usec)));
>> #else
>> std::time_t __sec = std::time(0);
>> - return system_clock::from_time_t(__sec);
>> + typedef chrono::time_point<system_clock, seconds> __from;
>> + return time_point_cast<system_clock::duration>
>> + (__from(chrono::seconds(__sec)));
>> #endif
>> }
>
> Yes, it does. My build worked fine after applying this patch to my
> local tree.
Excellent, thanks. I'll commit that in an hour or two when I get home.