|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r63877 - sandbox/chrono/boost/chrono
From: vicente.botet_at_[hidden]
Date: 2010-07-11 11:31:46
Author: viboes
Date: 2010-07-11 11:31:45 EDT (Sun, 11 Jul 2010)
New Revision: 63877
URL: http://svn.boost.org/trac/boost/changeset/63877
Log:
* Take care of Boost.System break on version 1.44
* Fix max macro issue
* Fix "warning C4244: 'argument' : conversion from 'const __int64' to 'const double', possible loss of data"
Text files modified:
sandbox/chrono/boost/chrono/chrono.hpp | 2 +-
sandbox/chrono/boost/chrono/stopwatch_accumulator_formatter.hpp | 3 ++-
sandbox/chrono/boost/chrono/suspendible_clock.hpp | 9 +++++++++
3 files changed, 12 insertions(+), 2 deletions(-)
Modified: sandbox/chrono/boost/chrono/chrono.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/chrono.hpp (original)
+++ sandbox/chrono/boost/chrono/chrono.hpp 2010-07-11 11:31:45 EDT (Sun, 11 Jul 2010)
@@ -466,7 +466,7 @@
template <class Rep>
struct duration_values
{
- static BOOST_CHRONO_CONSTEXPR Rep m_min_imp(boost::false_type) {return -max();}
+ static BOOST_CHRONO_CONSTEXPR Rep m_min_imp(boost::false_type) {return -max BOOST_PREVENT_MACRO_SUBSTITUTION ();}
static BOOST_CHRONO_CONSTEXPR Rep m_min_imp(boost::true_type) {return zero();}
public:
static BOOST_CHRONO_CONSTEXPR Rep zero() {return Rep(0);}
Modified: sandbox/chrono/boost/chrono/stopwatch_accumulator_formatter.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/stopwatch_accumulator_formatter.hpp (original)
+++ sandbox/chrono/boost/chrono/stopwatch_accumulator_formatter.hpp 2010-07-11 11:31:45 EDT (Sun, 11 Jul 2010)
@@ -98,7 +98,8 @@
break;
case 'a':
os << ((accumulators::count(acc)>0)
- ? boost::chrono::duration<double>(duration_t(typename duration_t::rep(accumulators::mean(acc)))).count()
+ //? boost::chrono::duration<double>(duration_t(typename duration_t::rep(accumulators::mean(acc)))).count()
+ ? boost::chrono::duration<double>(duration_t(accumulators::sum(acc))).count() / accumulators::count(acc)
: 0);
break;
case 'c':
Modified: sandbox/chrono/boost/chrono/suspendible_clock.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/suspendible_clock.hpp (original)
+++ sandbox/chrono/boost/chrono/suspendible_clock.hpp 2010-07-11 11:31:45 EDT (Sun, 11 Jul 2010)
@@ -10,6 +10,7 @@
#ifndef BOOST_CHRONO_SUSPENDIBLE_CLOCK_HPP
#define BOOST_CHRONO_SUSPENDIBLE_CLOCK_HPP
+#include <boost/version.hpp>
#include <boost/chrono/chrono.hpp>
#include <boost/chrono/scoped_suspend.hpp>
#include <boost/system/error_code.hpp>
@@ -90,13 +91,21 @@
} else {
ptr=(new(std::nothrow) thread_specific_context());
if (ptr==0) {
+#if (BOOST_VERSION / 100 % 1000) < 44
ec.assign( system::errc::resource_unavailable_try_again, system::generic_category );
+#else
+ ec.assign( system::errc::resource_unavailable_try_again, system::generic_category() );
+#endif
return 0;
}
try {
ptr_.reset(ptr);
} catch (...) {
+#if (BOOST_VERSION / 100 % 1000) < 44
ec.assign( system::errc::resource_unavailable_try_again, system::generic_category );
+#else
+ ec.assign( system::errc::resource_unavailable_try_again, system::generic_category() );
+#endif
return 0;
}
}
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