summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Roelofs <jonathan@codesourcery.com>2014-09-02 21:14:38 +0000
committerJonathan Roelofs <jonathan@codesourcery.com>2014-09-02 21:14:38 +0000
commitc59e585126d36051c0913d432ff224ef97a8583e (patch)
tree29df22bc373e286d0dced7be57170e3aef25cb16
parent726d6a12ad6ee2942a5de304ffd994f38e6cfb26 (diff)
downloadbcm5719-llvm-c59e585126d36051c0913d432ff224ef97a8583e.tar.gz
bcm5719-llvm-c59e585126d36051c0913d432ff224ef97a8583e.zip
Partially address a FIXME in steady_clock::now()
http://reviews.llvm.org/D4045 llvm-svn: 216949
-rw-r--r--libcxx/include/__config5
-rw-r--r--libcxx/include/chrono4
-rw-r--r--libcxx/src/chrono.cpp3
-rw-r--r--libcxx/test/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp1
-rw-r--r--libcxx/test/utilities/time/time.clock/time.clock.steady/now.pass.cpp2
5 files changed, 15 insertions, 0 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config
index b75176c8804..2eb9e55f9c1 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -650,6 +650,11 @@ template <unsigned> struct __static_assert_check {};
# define _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 1
#endif
+#if (!defined(_POSIX_TIMERS) || _POSIX_TIMERS <= 0) || \
+ (!defined(_POSIX_MONOTONIC_CLOCK) || _POSIX_MONOTONIC_CLOCK <= 0)
+#define _LIBCPP_HAS_NO_MONOTONIC_CLOCK
+#endif
+
#ifndef _LIBCPP_STD_VER
# if __cplusplus <= 201103L
# define _LIBCPP_STD_VER 11
diff --git a/libcxx/include/chrono b/libcxx/include/chrono
index 2c65eee7d06..9229234ce55 100644
--- a/libcxx/include/chrono
+++ b/libcxx/include/chrono
@@ -926,6 +926,7 @@ public:
static time_point from_time_t(time_t __t) _NOEXCEPT;
};
+#ifndef _LIBCPP_HAS_NO_MONOTONIC_CLOCK
class _LIBCPP_TYPE_VIS steady_clock
{
public:
@@ -939,6 +940,9 @@ public:
};
typedef steady_clock high_resolution_clock;
+#else
+typedef system_clock high_resolution_clock;
+#endif
} // chrono
diff --git a/libcxx/src/chrono.cpp b/libcxx/src/chrono.cpp
index 15a6f466a77..83661b0626d 100644
--- a/libcxx/src/chrono.cpp
+++ b/libcxx/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;
@@ -127,6 +128,8 @@ steady_clock::now() _NOEXCEPT
}
#endif // __APPLE__
+#endif // !_LIBCPP_HAS_NO_MONOTONIC_CLOCK
+
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/test/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp b/libcxx/test/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp
index bec678713c2..2ec62c4bc9c 100644
--- a/libcxx/test/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp
+++ b/libcxx/test/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp
@@ -11,6 +11,7 @@
// darwin11 and darwin12:
// XFAIL: with_system_lib=x86_64-apple-darwin11
// XFAIL: with_system_lib=x86_64-apple-darwin12
+// UNSUPPORTED: no-monotonic-clock
// <chrono>
diff --git a/libcxx/test/utilities/time/time.clock/time.clock.steady/now.pass.cpp b/libcxx/test/utilities/time/time.clock/time.clock.steady/now.pass.cpp
index 0c6ebe6f3bb..bd1735ae8f1 100644
--- a/libcxx/test/utilities/time/time.clock/time.clock.steady/now.pass.cpp
+++ b/libcxx/test/utilities/time/time.clock/time.clock.steady/now.pass.cpp
@@ -6,6 +6,8 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: no-monotonic-clock
// <chrono>
OpenPOWER on IntegriCloud