Details
- Reviewers
mclow.lists danalbert
Diff Detail
Event Timeline
On a system w/o _POSIX_MONOTONIC_CLOCK, this will change from "libc++ will not build" to "it will build a non-conforming library"
That doesn't seem like an improvement to me.
Is it possible to build a monotonic clock out of a non-monotonic clock in
software only?
I could force it to be monotonic with some static storage and a max=, but would
that be correct?
Jon
mclow and I discussed this offline, and max= is not going to work:
20.12.7.2/1: Objects of class steady_clock represent clocks for which values of time_point never decrease as physical time advances and for which values of time_point advance at a steady rate relative to real time.
I'll look into what breaks if steady_clock isn't provided on systems without _POSIX_MONOTONIC_CLOCK, and go from there.
On systems without a monotonic clock, it's probably better to not have steady_clock than to have a non-conforming one.
Since steady_clock is used for timed mutexes and such, something like: http://reviews.llvm.org/D3969 is probably necessary to actually build libc++ without a a monotonic clock. I'll be picking that patch up for upstreaming again here shortly.
ping x2
libcxx/test/lit.site.cfg | ||
---|---|---|
11 ↗ | (On Diff #12840) | FYI, I don't intend for this to go upstream... this is just here as an example usage. |
include/__config | ||
---|---|---|
644 | As mentioned on http://reviews.llvm.org/D3969, _LIBCPP_HAS_NO_MONOTONIC_CLOCK will more closely match the other configs. |
include/chrono | ||
---|---|---|
944 | I concur - no need for a warning. |
include/chrono | ||
---|---|---|
943 | Ah, alright. Fine by me. |
Rename the flag to _LIBCPP_HAS_NO_MONOTONIC_CLOCK, and change the XFAILs to UNSUPPORTEDs.
As mentioned on http://reviews.llvm.org/D3969, _LIBCPP_HAS_NO_MONOTONIC_CLOCK will more closely match the other configs.