Compare commits

..

4 Commits

Author SHA1 Message Date
d73551d222 This commit was manufactured by cvs2svn to create tag
'Version_1_33_1'.

[SVN r31916]
2005-12-05 14:04:06 +00:00
df20953a5e QNX 6.3 Momentics w/Dinkumware defines the integer types with slightly different names. So provide the standard names.
[SVN r30865]
2005-09-07 21:52:13 +00:00
9655c23b86 Enable support for Dragonfly BSD
[SVN r30647]
2005-08-24 15:45:17 +00:00
07b0839716 This commit was manufactured by cvs2svn to create branch 'RC_1_33_0'.
[SVN r30300]
2005-07-28 18:22:24 +00:00
9 changed files with 57 additions and 69 deletions

View File

@ -113,24 +113,10 @@ void integral_constant_type_check(T1, T2)
assert(sizeof(T1) == sizeof(T2)); assert(sizeof(T1) == sizeof(T2));
assert(t1 == t2); assert(t1 == t2);
#endif #endif
#if defined(BOOST_HAS_STDINT_H)
// native headers are permitted to promote small
// unsigned types to type int:
if(sizeof(T1) >= sizeof(int))
{
if(t1 > 0)
assert(t2 > 0);
else
assert(!(t2 > 0));
}
else if(t1 < 0)
assert(!(t2 > 0));
#else
if(t1 > 0) if(t1 > 0)
assert(t2 > 0); assert(t2 > 0);
else else
assert(!(t2 > 0)); assert(!(t2 > 0));
#endif
} }

View File

@ -202,9 +202,10 @@ href="../../../people/daryle_walker.html">Daryle Walker</a>.</p>
<p>Revised September 23, 2001</p> <p>Revised September 23, 2001</p>
<p>&copy; Copyright Daryle Walker 2001. Use, modification, and distribution are <p>&copy; Copyright Daryle Walker 2001. Permission to copy, use,
subject to the Boost Software License, Version 1.0. (See accompanying file <a modify, sell and distribute this document is granted provided this
href="../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or a copy at &lt;<a copyright notice appears in all copies. This document is provided
href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>&gt;.)</p> &quot;as is&quot; without express or implied warranty, and with no claim
as to its suitability for any purpose.</p>
</body> </body>
</html> </html>

View File

@ -112,9 +112,10 @@ href="../../../people/daryle_walker.html">Daryle Walker</a>.</p>
<p>Revised October 12, 2001</p> <p>Revised October 12, 2001</p>
<p>&copy; Copyright Daryle Walker 2001. Use, modification, and distribution are <p>&copy; Copyright Daryle Walker 2001. Permission to copy, use,
subject to the Boost Software License, Version 1.0. (See accompanying file <a modify, sell and distribute this document is granted provided this
href="../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or a copy at &lt;<a copyright notice appears in all copies. This document is provided
href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>&gt;.)</p> &quot;as is&quot; without express or implied warranty, and with no claim
as to its suitability for any purpose.</p>
</body> </body>
</html> </html>

View File

@ -173,7 +173,6 @@ namespace boost {
#else // BOOST_HAS_STDINT_H #else // BOOST_HAS_STDINT_H
# include <boost/limits.hpp> // implementation artifact; not part of interface # include <boost/limits.hpp> // implementation artifact; not part of interface
# include <limits.h> // needed for limits macros
namespace boost namespace boost

View File

@ -21,9 +21,9 @@
// These are an implementation detail and not part of the interface // These are an implementation detail and not part of the interface
#include <limits.h> #include <limits.h>
// we need wchar.h for WCHAR_MAX/MIN but not all platforms provide it, // we need wchar.h for WCHAR_MAX/MIN but not all platforms provide it,
// and some may have <wchar.h> but not <cwchar> ... // and some may have <wchar.h> but not <cwchar> ...
#if !defined(BOOST_NO_INTRINSIC_WCHAR_T) && (!defined(BOOST_NO_CWCHAR) || defined(sun) || defined(__sun) || defined(__QNX__)) #if !defined(BOOST_NO_INTRINSIC_WCHAR_T) && (!defined(BOOST_NO_CWCHAR) || defined(sun) || defined(__sun))
#include <wchar.h> #include <wchar.h>
#endif #endif

View File

@ -204,9 +204,10 @@ value-based sized templates.</p>
<p>Revised May 20, 2001</p> <p>Revised May 20, 2001</p>
<p>&copy; Copyright Beman Dawes 1999. Use, modification, and distribution are <p>&copy; Copyright Beman Dawes 1999. Permission to copy, use, modify,
subject to the Boost Software License, Version 1.0. (See accompanying file <a sell and distribute this document is granted provided this copyright
href="../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or a copy at &lt;<a notice appears in all copies. This document is provided &quot;as
href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>&gt;.)</p> is&quot; without express or implied warranty, and with no claim as to
its suitability for any purpose.</p>
</body> </body>
</html> </html>

View File

@ -19,16 +19,16 @@
#include <iostream> // for std::cout (std::endl indirectly) #include <iostream> // for std::cout (std::endl indirectly)
#define PRIVATE_HIGH_BIT_SLOW_TEST(v) BOOST_CHECK( ::boost::high_bit_mask_t< \ #define PRIVATE_HIGH_BIT_SLOW_TEST(v) BOOST_TEST( ::boost::high_bit_mask_t< \
(v) >::high_bit == (1ul << (v)) ); (v) >::high_bit == (1ul << (v)) );
#define PRIVATE_HIGH_BIT_FAST_TEST(v) BOOST_CHECK( ::boost::high_bit_mask_t< \ #define PRIVATE_HIGH_BIT_FAST_TEST(v) BOOST_TEST( ::boost::high_bit_mask_t< \
(v) >::high_bit_fast == (1ul << (v)) ); (v) >::high_bit_fast == (1ul << (v)) );
#define PRIVATE_HIGH_BIT_TEST(v) do { PRIVATE_HIGH_BIT_SLOW_TEST(v); \ #define PRIVATE_HIGH_BIT_TEST(v) do { PRIVATE_HIGH_BIT_SLOW_TEST(v); \
PRIVATE_HIGH_BIT_FAST_TEST(v); } while (false) PRIVATE_HIGH_BIT_FAST_TEST(v); } while (false)
#define PRIVATE_LOW_BITS_SLOW_TEST(v) BOOST_CHECK( ::boost::low_bits_mask_t< \ #define PRIVATE_LOW_BITS_SLOW_TEST(v) BOOST_TEST( ::boost::low_bits_mask_t< \
(v) >::sig_bits == ((1ul << (v)) - 1) ); (v) >::sig_bits == ((1ul << (v)) - 1) );
#define PRIVATE_LOW_BITS_FAST_TEST(v) BOOST_CHECK( ::boost::low_bits_mask_t< \ #define PRIVATE_LOW_BITS_FAST_TEST(v) BOOST_TEST( ::boost::low_bits_mask_t< \
(v) >::sig_bits_fast == ((1ul << (v)) - 1) ); (v) >::sig_bits_fast == ((1ul << (v)) - 1) );
#define PRIVATE_LOW_BITS_TEST(v) do { PRIVATE_LOW_BITS_SLOW_TEST(v); \ #define PRIVATE_LOW_BITS_TEST(v) do { PRIVATE_LOW_BITS_SLOW_TEST(v); \
PRIVATE_LOW_BITS_FAST_TEST(v); } while (false) PRIVATE_LOW_BITS_FAST_TEST(v); } while (false)

View File

@ -20,7 +20,7 @@
// Macros to compact code // Macros to compact code
#define PRIVATE_LB_TEST( v, e ) BOOST_CHECK( ::boost::static_log2<v>::value == e ) #define PRIVATE_LB_TEST( v, e ) BOOST_TEST( ::boost::static_log2<v>::value == e )
#define PRIVATE_PRINT_LB( v ) ::std::cout << "boost::static_log2<" << (v) \ #define PRIVATE_PRINT_LB( v ) ::std::cout << "boost::static_log2<" << (v) \
<< "> = " << ::boost::static_log2< (v) >::value << '.' << ::std::endl << "> = " << ::boost::static_log2< (v) >::value << '.' << ::std::endl

View File

@ -11,7 +11,7 @@
// 23 Sep 2001 Initial version (Daryle Walker) // 23 Sep 2001 Initial version (Daryle Walker)
#define BOOST_INCLUDE_MAIN #define BOOST_INCLUDE_MAIN
#include <boost/test/test_tools.hpp> // for main, BOOST_CHECK #include <boost/test/test_tools.hpp> // for main, BOOST_TEST
#include <boost/cstdlib.hpp> // for boost::exit_success #include <boost/cstdlib.hpp> // for boost::exit_success
#include <boost/integer/static_min_max.hpp> // for boost::static_signed_min, etc. #include <boost/integer/static_min_max.hpp> // for boost::static_signed_min, etc.
@ -37,57 +37,57 @@ test_main
// Two positives // Two positives
cout << "Doing tests with two positive values." << endl; cout << "Doing tests with two positive values." << endl;
BOOST_CHECK( (static_signed_min< 9, 14>::value) == 9 ); BOOST_TEST( (static_signed_min< 9, 14>::value) == 9 );
BOOST_CHECK( (static_signed_max< 9, 14>::value) == 14 ); BOOST_TEST( (static_signed_max< 9, 14>::value) == 14 );
BOOST_CHECK( (static_signed_min<14, 9>::value) == 9 ); BOOST_TEST( (static_signed_min<14, 9>::value) == 9 );
BOOST_CHECK( (static_signed_max<14, 9>::value) == 14 ); BOOST_TEST( (static_signed_max<14, 9>::value) == 14 );
BOOST_CHECK( (static_unsigned_min< 9, 14>::value) == 9 ); BOOST_TEST( (static_unsigned_min< 9, 14>::value) == 9 );
BOOST_CHECK( (static_unsigned_max< 9, 14>::value) == 14 ); BOOST_TEST( (static_unsigned_max< 9, 14>::value) == 14 );
BOOST_CHECK( (static_unsigned_min<14, 9>::value) == 9 ); BOOST_TEST( (static_unsigned_min<14, 9>::value) == 9 );
BOOST_CHECK( (static_unsigned_max<14, 9>::value) == 14 ); BOOST_TEST( (static_unsigned_max<14, 9>::value) == 14 );
// Two negatives // Two negatives
cout << "Doing tests with two negative values." << endl; cout << "Doing tests with two negative values." << endl;
BOOST_CHECK( (static_signed_min< -8, -101>::value) == -101 ); BOOST_TEST( (static_signed_min< -8, -101>::value) == -101 );
BOOST_CHECK( (static_signed_max< -8, -101>::value) == -8 ); BOOST_TEST( (static_signed_max< -8, -101>::value) == -8 );
BOOST_CHECK( (static_signed_min<-101, -8>::value) == -101 ); BOOST_TEST( (static_signed_min<-101, -8>::value) == -101 );
BOOST_CHECK( (static_signed_max<-101, -8>::value) == -8 ); BOOST_TEST( (static_signed_max<-101, -8>::value) == -8 );
// With zero // With zero
cout << "Doing tests with zero and a positive or negative value." << endl; cout << "Doing tests with zero and a positive or negative value." << endl;
BOOST_CHECK( (static_signed_min< 0, 14>::value) == 0 ); BOOST_TEST( (static_signed_min< 0, 14>::value) == 0 );
BOOST_CHECK( (static_signed_max< 0, 14>::value) == 14 ); BOOST_TEST( (static_signed_max< 0, 14>::value) == 14 );
BOOST_CHECK( (static_signed_min<14, 0>::value) == 0 ); BOOST_TEST( (static_signed_min<14, 0>::value) == 0 );
BOOST_CHECK( (static_signed_max<14, 0>::value) == 14 ); BOOST_TEST( (static_signed_max<14, 0>::value) == 14 );
BOOST_CHECK( (static_unsigned_min< 0, 14>::value) == 0 ); BOOST_TEST( (static_unsigned_min< 0, 14>::value) == 0 );
BOOST_CHECK( (static_unsigned_max< 0, 14>::value) == 14 ); BOOST_TEST( (static_unsigned_max< 0, 14>::value) == 14 );
BOOST_CHECK( (static_unsigned_min<14, 0>::value) == 0 ); BOOST_TEST( (static_unsigned_min<14, 0>::value) == 0 );
BOOST_CHECK( (static_unsigned_max<14, 0>::value) == 14 ); BOOST_TEST( (static_unsigned_max<14, 0>::value) == 14 );
BOOST_CHECK( (static_signed_min< 0, -101>::value) == -101 ); BOOST_TEST( (static_signed_min< 0, -101>::value) == -101 );
BOOST_CHECK( (static_signed_max< 0, -101>::value) == 0 ); BOOST_TEST( (static_signed_max< 0, -101>::value) == 0 );
BOOST_CHECK( (static_signed_min<-101, 0>::value) == -101 ); BOOST_TEST( (static_signed_min<-101, 0>::value) == -101 );
BOOST_CHECK( (static_signed_max<-101, 0>::value) == 0 ); BOOST_TEST( (static_signed_max<-101, 0>::value) == 0 );
// With identical // With identical
cout << "Doing tests with two identical values." << endl; cout << "Doing tests with two identical values." << endl;
BOOST_CHECK( (static_signed_min<0, 0>::value) == 0 ); BOOST_TEST( (static_signed_min<0, 0>::value) == 0 );
BOOST_CHECK( (static_signed_max<0, 0>::value) == 0 ); BOOST_TEST( (static_signed_max<0, 0>::value) == 0 );
BOOST_CHECK( (static_unsigned_min<0, 0>::value) == 0 ); BOOST_TEST( (static_unsigned_min<0, 0>::value) == 0 );
BOOST_CHECK( (static_unsigned_max<0, 0>::value) == 0 ); BOOST_TEST( (static_unsigned_max<0, 0>::value) == 0 );
BOOST_CHECK( (static_signed_min<14, 14>::value) == 14 ); BOOST_TEST( (static_signed_min<14, 14>::value) == 14 );
BOOST_CHECK( (static_signed_max<14, 14>::value) == 14 ); BOOST_TEST( (static_signed_max<14, 14>::value) == 14 );
BOOST_CHECK( (static_unsigned_min<14, 14>::value) == 14 ); BOOST_TEST( (static_unsigned_min<14, 14>::value) == 14 );
BOOST_CHECK( (static_unsigned_max<14, 14>::value) == 14 ); BOOST_TEST( (static_unsigned_max<14, 14>::value) == 14 );
BOOST_CHECK( (static_signed_min< -101, -101>::value) == -101 ); BOOST_TEST( (static_signed_min< -101, -101>::value) == -101 );
BOOST_CHECK( (static_signed_max< -101, -101>::value) == -101 ); BOOST_TEST( (static_signed_max< -101, -101>::value) == -101 );
return boost::exit_success; return boost::exit_success;
} }