Endian: get tests working on more compilers, eliminate compiler warnings

git-svn-id: http://svn.boost.org/svn/boost/sandbox/endian@51866 b8fc166d-592f-0410-95f2-cb63ce0dd405
This commit is contained in:
bemandawes committed 2009-03-20 13:40:24 +00:00
1 parent 40fa3beec4
commit 22ccd7a2e4
6 files changed
+107 -70

No files matched your search

+5 -5
View File
@@ -65,16 +65,16 @@ namespace boost
friend T& operator<<=(T& x, IntegerType y) { return x = +x << y; }
friend T& operator>>=(T& x, IntegerType y) { return x = +x >> y; }
// A few binary arithmetic operations not covered by operators base class.
friend IntegerType operator<<(const T& x, IntegerType y) { return +x << y; }
friend IntegerType operator>>(const T& x, IntegerType y) { return +x >> y; }
// Auto-increment and auto-decrement can be defined in terms of the
// arithmetic operations.
friend T& operator++(T& x) { return x += 1; }
friend T& operator--(T& x) { return x -= 1; }
# ifndef BOOST_MINIMAL_INTEGER_COVER_OPERATORS
// A few binary arithmetic operations not covered by operators base class.
friend IntegerType operator<<(const T& x, IntegerType y) { return +x << y; }
friend IntegerType operator>>(const T& x, IntegerType y) { return +x >> y; }
# ifdef BOOST_MINIMAL_INTEGER_COVER_OPERATORS
friend T operator++(T& x, int)
{
T tmp(x);
+12
View File
@@ -21,6 +21,14 @@
#ifndef BOOST_ENDIAN_HPP
#define BOOST_ENDIAN_HPP
#ifdef BOOST_ENDIAN_LOG
# include <iostream>
#endif
#if defined(__BORLANDC__) || defined( __CODEGEARC__)
# pragma pack(push, 1)
#endif
#include <boost/config.hpp>
#include <boost/detail/endian.hpp>
#define BOOST_MINIMAL_INTEGER_COVER_OPERATORS
@@ -411,4 +419,8 @@ namespace boost
} // namespace integer
} // namespace boost
#if defined(__BORLANDC__) || defined( __CODEGEARC__)
# pragma pack(pop)
#endif
#endif // BOOST_ENDIAN_HPP