aboutsummaryrefslogtreecommitdiffstats
path: root/src/chrono.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-01-07 21:08:01 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-01-07 21:08:01 +0000
commitf857581820d15e410e9945d2fcd5f7163be25a96 (patch)
tree41f38760e19d47a9e21d0f64ece2bddaaab8aaf7 /src/chrono.cpp
parenta5b2dbc259e289ea23fe9aebb34eba2c1dc7fefb (diff)
downloadsrc-f857581820d15e410e9945d2fcd5f7163be25a96.tar.gz
src-f857581820d15e410e9945d2fcd5f7163be25a96.zip
Vendor import of libc++ trunk r224926:vendor/libc++/r224926
Notes
Notes: svn path=/vendor/libc++/dist/; revision=276792 svn path=/vendor/libc++/r224926/; revision=276793; tag=vendor/libc++/r224926
Diffstat (limited to 'src/chrono.cpp')
-rw-r--r--src/chrono.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/chrono.cpp b/src/chrono.cpp
index 15a6f466a77d..456941144e01 100644
--- a/src/chrono.cpp
+++ b/src/chrono.cpp
@@ -46,6 +46,7 @@ system_clock::from_time_t(time_t t) _NOEXCEPT
return system_clock::time_point(seconds(t));
}
+#ifndef _LIBCPP_HAS_NO_MONOTONIC_CLOCK
// steady_clock
const bool steady_clock::is_steady;
@@ -108,10 +109,8 @@ steady_clock::now() _NOEXCEPT
}
#else // __APPLE__
-// FIXME: We assume that clock_gettime(CLOCK_MONOTONIC) works on
-// non-apple systems. Instead, we should check _POSIX_TIMERS and
-// _POSIX_MONOTONIC_CLOCK and fall back to something else if those
-// don't exist.
+// FIXME: if _LIBCPP_HAS_NO_MONOTONIC_CLOCK, then clock_gettime isn't going to
+// work. It may be possible to fall back on something else, depending on the system.
// Warning: If this is not truly steady, then it is non-conforming. It is
// better for it to not exist and have the rest of libc++ use system_clock
@@ -127,6 +126,8 @@ steady_clock::now() _NOEXCEPT
}
#endif // __APPLE__
+#endif // !_LIBCPP_HAS_NO_MONOTONIC_CLOCK
+
}
_LIBCPP_END_NAMESPACE_STD