Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78435 - in trunk/boost/chrono: . detail/no_warning io/utility
From: vicente.botet_at_[hidden]
Date: 2012-05-12 08:55:47


Author: viboes
Date: 2012-05-12 08:55:46 EDT (Sat, 12 May 2012)
New Revision: 78435
URL: http://svn.boost.org/trac/boost/changeset/78435

Log:
Chrono: Added ABI clash protection for duration and timepoint classes
Text files modified:
   trunk/boost/chrono/detail/no_warning/signed_unsigned_cmp.hpp | 2 +-
   trunk/boost/chrono/duration.hpp | 9 +++++++++
   trunk/boost/chrono/io/utility/manip_base.hpp | 2 +-
   trunk/boost/chrono/system_clocks.hpp | 2 ++
   trunk/boost/chrono/time_point.hpp | 19 ++++++++++++++-----
   5 files changed, 27 insertions(+), 7 deletions(-)

Modified: trunk/boost/chrono/detail/no_warning/signed_unsigned_cmp.hpp
==============================================================================
--- trunk/boost/chrono/detail/no_warning/signed_unsigned_cmp.hpp (original)
+++ trunk/boost/chrono/detail/no_warning/signed_unsigned_cmp.hpp 2012-05-12 08:55:46 EDT (Sat, 12 May 2012)
@@ -41,4 +41,4 @@
 } // namespace detail
 } // namespace chrono
 
-#endif // BOOST_CHRONO_DETAIL_IS_EVENLY_DIVISIBLE_BY_HPP
+#endif // BOOST_CHRONO_DETAIL_NO_WARNING_SIGNED_UNSIGNED_CMP_HPP

Modified: trunk/boost/chrono/duration.hpp
==============================================================================
--- trunk/boost/chrono/duration.hpp (original)
+++ trunk/boost/chrono/duration.hpp 2012-05-12 08:55:46 EDT (Sat, 12 May 2012)
@@ -58,6 +58,10 @@
 #define BOOST_CHRONO_SECOND_TEMPLATE_PARAMETER_OF_TIME_POINT_MUST_BE_A_BOOST_CHRONO_DURATION "Second template parameter of time_point must be a boost::chrono::duration"
 #endif
 
+#ifndef BOOST_CHRONO_HEADER_ONLY
+// this must occur after all of the includes and before any code appears:
+#include <boost/config/abi_prefix.hpp> // must be the last #include
+#endif
 
 //----------------------------------------------------------------------------//
 // //
@@ -783,4 +787,9 @@
 } // namespace chrono
 } // namespace boost
 
+#ifndef BOOST_CHRONO_HEADER_ONLY
+// the suffix header occurs after all of our code:
+#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
+#endif
+
 #endif // BOOST_CHRONO_DURATION_HPP

Modified: trunk/boost/chrono/io/utility/manip_base.hpp
==============================================================================
--- trunk/boost/chrono/io/utility/manip_base.hpp (original)
+++ trunk/boost/chrono/io/utility/manip_base.hpp 2012-05-12 08:55:46 EDT (Sat, 12 May 2012)
@@ -1,4 +1,4 @@
-// boost/chrono/utility/locale_facet_ptr.hpp ------------------------------------------------------------//
+// boost/chrono/utility/manip_base.hpp ------------------------------------------------------------//
 
 // Copyright 2011 Vicente J. Botet Escriba
 

Modified: trunk/boost/chrono/system_clocks.hpp
==============================================================================
--- trunk/boost/chrono/system_clocks.hpp (original)
+++ trunk/boost/chrono/system_clocks.hpp 2012-05-12 08:55:46 EDT (Sat, 12 May 2012)
@@ -77,6 +77,7 @@
 # define BOOST_SYSTEM_CLOCK_DURATION boost::chrono::nanoseconds
 #endif
 
+// this must occur after all of the includes and before any code appears:
 #ifndef BOOST_CHRONO_HEADER_ONLY
 #include <boost/config/abi_prefix.hpp> // must be the last #include
 #endif
@@ -221,6 +222,7 @@
 } // namespace boost
 
 #ifndef BOOST_CHRONO_HEADER_ONLY
+// the suffix header occurs after all of our code:
 #include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
 #else
 #include <boost/chrono/detail/inlined/chrono.hpp>

Modified: trunk/boost/chrono/time_point.hpp
==============================================================================
--- trunk/boost/chrono/time_point.hpp (original)
+++ trunk/boost/chrono/time_point.hpp 2012-05-12 08:55:46 EDT (Sat, 12 May 2012)
@@ -2,7 +2,7 @@
 
 // Copyright 2008 Howard Hinnant
 // Copyright 2008 Beman Dawes
-// Copyright 2009-2011 Vicente J. Botet Escriba
+// Copyright 2009-2012 Vicente J. Botet Escriba
 
 // Distributed under the Boost Software License, Version 1.0.
 // See http://www.boost.org/LICENSE_1_0.txt
@@ -34,6 +34,10 @@
 #include <iostream>
 #include <boost/chrono/detail/system.hpp>
 
+#ifndef BOOST_CHRONO_HEADER_ONLY
+// this must occur after all of the includes and before any code appears:
+#include <boost/config/abi_prefix.hpp> // must be the last #include
+#endif
 
 //----------------------------------------------------------------------------//
 // //
@@ -160,7 +164,7 @@
         typedef typename duration::rep rep;
         typedef typename duration::period period;
         typedef Duration difference_type;
-
+
     private:
         duration d_;
 
@@ -194,7 +198,7 @@
 
         // arithmetic
 
-#ifdef BOOST_CHRONO_EXTENSIONS
+#ifdef BOOST_CHRONO_EXTENSIONS
         BOOST_CONSTEXPR
         time_point operator+() const {return *this;}
         BOOST_CONSTEXPR
@@ -202,13 +206,13 @@
         time_point& operator++() {++d_; return *this;}
         time_point operator++(int) {return time_point(d_++);}
         time_point& operator--() {--d_; return *this;}
- time_point operator--(int) {return time_point(d_--);}
+ time_point operator--(int) {return time_point(d_--);}
 
         time_point& operator+=(const rep& r) {d_ += duration(r); return *this;}
         time_point& operator-=(const rep& r) {d_ -= duration(r); return *this;}
 
 #endif
-
+
         time_point& operator+=(const duration& d) {d_ += d; return *this;}
         time_point& operator-=(const duration& d) {d_ -= d; return *this;}
 
@@ -368,4 +372,9 @@
 } // namespace chrono
 } // namespace boost
 
+#ifndef BOOST_CHRONO_HEADER_ONLY
+// the suffix header occurs after all of our code:
+#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
+#endif
+
 #endif // BOOST_CHRONO_TIME_POINT_HPP


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