Rename the flag to _LIBCPP_HAS_NO_MONOTONIC_CLOCK, and change the XFAILs to
UNSUPPORTEDs.
http://reviews.llvm.org/D4045
Files:
include/__config
include/chrono
src/chrono.cpp
test/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp
test/utilities/time/time.clock/time.clock.steady/now.pass.cpp
Index: include/__config
===================================================================
--- include/__config
+++ include/__config
@@ -650,6 +650,11 @@
# 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
Index: include/chrono
===================================================================
--- include/chrono
+++ include/chrono
@@ -926,6 +926,7 @@
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 @@
};
typedef steady_clock high_resolution_clock;
+#else
+typedef system_clock high_resolution_clock;
+#endif
} // chrono
Index: src/chrono.cpp
===================================================================
--- src/chrono.cpp
+++ src/chrono.cpp
@@ -46,6 +46,7 @@
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 @@
}
#endif // __APPLE__
+#endif // !_LIBCPP_HAS_NO_MONOTONIC_CLOCK
+
}
_LIBCPP_END_NAMESPACE_STD
Index: test/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp
===================================================================
--- test/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp
+++ 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>
Index: test/utilities/time/time.clock/time.clock.steady/now.pass.cpp
===================================================================
--- test/utilities/time/time.clock/time.clock.steady/now.pass.cpp
+++ 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>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits