Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65880 - in sandbox/chrono/boost/chrono: . detail
From: vicente.botet_at_[hidden]
Date: 2010-10-10 12:46:46


Author: viboes
Date: 2010-10-10 12:46:42 EDT (Sun, 10 Oct 2010)
New Revision: 65880
URL: http://svn.boost.org/trac/boost/changeset/65880

Log:
Chrono:
* Refactor compatibility with Boost.Systems system_category break
* Refactor new public ratio_gcd
Added:
   sandbox/chrono/boost/chrono/detail/system.hpp (contents, props changed)
Text files modified:
   sandbox/chrono/boost/chrono/duration.hpp | 6 ++++--
   sandbox/chrono/boost/chrono/process_cpu_clocks.hpp | 1 +
   sandbox/chrono/boost/chrono/system_clocks.hpp | 4 ++--
   sandbox/chrono/boost/chrono/thread_clock.hpp | 3 +--
   4 files changed, 8 insertions(+), 6 deletions(-)

Added: sandbox/chrono/boost/chrono/detail/system.hpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/boost/chrono/detail/system.hpp 2010-10-10 12:46:42 EDT (Sun, 10 Oct 2010)
@@ -0,0 +1,19 @@
+// Copyright 2009-2010 Vicente J. Botet Escriba
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+#ifndef BOOST_CHRONO_DETAIL_SYSTEM_HPP
+#define BOOST_CHRONO_DETAIL_SYSTEM_HPP
+
+#include <boost/version.hpp>
+#include <boost/system/error_code.hpp>
+
+#if ((BOOST_VERSION / 100000) < 2) && ((BOOST_VERSION / 100 % 1000) < 44)
+#define BOOST_CHRONO_SYSTEM_CATEGORY boost::system::system_category
+#else
+#define BOOST_CHRONO_SYSTEM_CATEGORY boost::system::system_category()
+#endif
+
+
+#endif

Modified: sandbox/chrono/boost/chrono/duration.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/duration.hpp (original)
+++ sandbox/chrono/boost/chrono/duration.hpp 2010-10-10 12:46:42 EDT (Sun, 10 Oct 2010)
@@ -50,6 +50,7 @@
 #include <boost/utility/enable_if.hpp>
 #include <boost/detail/workaround.hpp>
 #include <boost/integer_traits.hpp>
+#include <boost/static_integer/static_gcd.hpp>
 
 #if !defined(BOOST_NO_STATIC_ASSERT) || !defined(BOOST_CHRONO_USES_MPL_ASSERT)
 #define BOOST_CHRONO_A_DURATION_REPRESENTATION_CAN_NOT_BE_A_DURATION "A duration representation can not be a duration"
@@ -423,7 +424,7 @@
                    chrono::duration<Rep2, Period2> >
 {
   typedef chrono::duration<typename common_type<Rep1, Rep2>::type,
- typename boost::detail::ratio_gcd<Period1, Period2>::type> type;
+ typename boost::ratio_gcd<Period1, Period2>::type> type;
 };
 
 
@@ -439,8 +440,9 @@
     template <class Rep, class Period>
     class duration
     {
+ //BOOST_CHRONO_STATIC_ASSERT(boost::is_integral<Rep>::value, BOOST_CHRONO_A_DURATION_REPRESENTATION_MUST_BE_INTEGRAL, ());
     BOOST_CHRONO_STATIC_ASSERT(!boost::chrono::detail::is_duration<Rep>::value, BOOST_CHRONO_A_DURATION_REPRESENTATION_CAN_NOT_BE_A_DURATION, ());
- BOOST_CHRONO_STATIC_ASSERT(boost::detail::is_ratio<Period>::value, BOOST_CHRONO_SECOND_TEMPLATE_PARAMETER_OF_DURATION_MUST_BE_A_STD_RATIO, ());
+ BOOST_CHRONO_STATIC_ASSERT(boost::ratio_detail::is_ratio<Period>::value, BOOST_CHRONO_SECOND_TEMPLATE_PARAMETER_OF_DURATION_MUST_BE_A_STD_RATIO, ());
     BOOST_CHRONO_STATIC_ASSERT(Period::num>0, BOOST_CHRONO_DURATION_PERIOD_MUST_BE_POSITIVE, ());
     public:
         typedef Rep rep;

Modified: sandbox/chrono/boost/chrono/process_cpu_clocks.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/process_cpu_clocks.hpp (original)
+++ sandbox/chrono/boost/chrono/process_cpu_clocks.hpp 2010-10-10 12:46:42 EDT (Sun, 10 Oct 2010)
@@ -14,6 +14,7 @@
 #include <boost/chrono/time_point.hpp>
 #include <boost/system/error_code.hpp>
 #include <boost/operators.hpp>
+#include <boost/chrono/detail/system.hpp>
 
 #include <boost/config/abi_prefix.hpp> // must be the last #include
 

Modified: sandbox/chrono/boost/chrono/system_clocks.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/system_clocks.hpp (original)
+++ sandbox/chrono/boost/chrono/system_clocks.hpp 2010-10-10 12:46:42 EDT (Sun, 10 Oct 2010)
@@ -62,10 +62,10 @@
 #include <boost/chrono/config.hpp>
 #include <boost/chrono/duration.hpp>
 #include <boost/chrono/time_point.hpp>
-
-#include <ctime>
+#include <boost/chrono/detail/system.hpp>
 #include <boost/system/error_code.hpp>
 
+#include <ctime>
 
 #ifdef BOOST_CHRONO_WINDOWS_API
 // The system_clock tick is 100 nanoseconds

Modified: sandbox/chrono/boost/chrono/thread_clock.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/thread_clock.hpp (original)
+++ sandbox/chrono/boost/chrono/thread_clock.hpp 2010-10-10 12:46:42 EDT (Sun, 10 Oct 2010)
@@ -14,8 +14,7 @@
 #include <boost/chrono/duration.hpp>
 #include <boost/chrono/time_point.hpp>
 #include <boost/system/error_code.hpp>
-//~ #include <boost/throw_exception.hpp>
-//~ #include <boost/system/system_error.hpp>
+#include <boost/chrono/detail/system.hpp>
 
 #include <boost/config/abi_prefix.hpp> // must be the last #include
 


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