Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58704 - in trunk: boost/asio libs/asio/test
From: chris_at_[hidden]
Date: 2010-01-05 07:20:11


Author: chris_kohlhoff
Date: 2010-01-05 07:20:10 EST (Tue, 05 Jan 2010)
New Revision: 58704
URL: http://svn.boost.org/trac/boost/changeset/58704

Log:
Drop back to second_clock if microsec_clock is unavailable. Refs #3743.

Text files modified:
   trunk/boost/asio/time_traits.hpp | 4 ++++
   trunk/libs/asio/test/deadline_timer.cpp | 4 ++++
   2 files changed, 8 insertions(+), 0 deletions(-)

Modified: trunk/boost/asio/time_traits.hpp
==============================================================================
--- trunk/boost/asio/time_traits.hpp (original)
+++ trunk/boost/asio/time_traits.hpp 2010-01-05 07:20:10 EST (Tue, 05 Jan 2010)
@@ -43,7 +43,11 @@
   /// Get the current time.
   static time_type now()
   {
+#if defined(BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK)
     return boost::posix_time::microsec_clock::universal_time();
+#else // defined(BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK)
+ return boost::posix_time::second_clock::universal_time();
+#endif // defined(BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK)
   }
 
   /// Add a duration to a time.

Modified: trunk/libs/asio/test/deadline_timer.cpp
==============================================================================
--- trunk/libs/asio/test/deadline_timer.cpp (original)
+++ trunk/libs/asio/test/deadline_timer.cpp 2010-01-05 07:20:10 EST (Tue, 05 Jan 2010)
@@ -59,7 +59,11 @@
 
 ptime now()
 {
+#if defined(BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK)
   return microsec_clock::universal_time();
+#else // defined(BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK)
+ return second_clock::universal_time();
+#endif // defined(BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK)
 }
 
 void deadline_timer_test()


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk