This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Default to --enable-libstdcxx-time=auto


On Fri, May 24, 2013 at 02:56:24PM +0100, Jonathan Wakely wrote:
> > Jonathan/Benjamin, could you please review the patch in the mean time,
> > so that if it works well for Rainer, it can be applied immediately and
> > 4.8.1-rc2 rolled, even during the weekend?
> 
> 
> In the fallback for steady_clock::now() would it be easier to just
> call system_clock::now() instead of duplicating its logic?

Yeah, that is what I've tried in
http://gcc.gnu.org/ml/gcc-patches/2013-05/msg01440.html
but it failed horribly, because the return type from both the static methods
is different (system_clock::time_point (aka chrono::time_point<system_clock,
duration>) in the first case,
steady_clock::time_point (aka chrono::time_point<steady_clock, duration>)
in the latter).  And there is no conversion in between the two.

Perhaps I'd have to do something like:
  return time_point(system_clock::now().time_since_epoch());
?  Can try that.

> I'm also wondering if
> 
> +  AC_DEFINE(_GLIBCXX_USE_CLOCK_MONOTONIC_SYSCALL, 1,
> +  [ Defined if clock_gettime syscall has monotonic clock support. ])
> 
> should be renamed to _GLIBCXX_USE_CLOCK_GETTIME_SYSCALL because it is
> defined when the syscall has CLOCK_REALTIME and clock_MONOTONIC
> support.

Yeah, that is a good suggestion, will change it.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]