Boost logo

Boost-Commit :

From: dwalker07_at_[hidden]
Date: 2008-07-24 07:43:03


Author: dlwalker
Date: 2008-07-24 07:43:02 EDT (Thu, 24 Jul 2008)
New Revision: 47754
URL: http://svn.boost.org/trac/boost/changeset/47754

Log:
Encapsulated the mutually exclusive 'long long' and '__int64' type families into a single interface
Added:
   trunk/boost/detail/extended_integer.hpp (contents, props changed)
Text files modified:
   trunk/boost/integer.hpp | 64 +++++++++++----------------------
   trunk/boost/integer_fwd.hpp | 8 ++-
   trunk/boost/integer_traits.hpp | 75 ++++-----------------------------------
   trunk/boost/limits.hpp | 46 ++++++------------------
   trunk/libs/integer/test/integer_test.cpp | 14 +++----
   5 files changed, 53 insertions(+), 154 deletions(-)

Added: trunk/boost/detail/extended_integer.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/detail/extended_integer.hpp 2008-07-24 07:43:02 EDT (Thu, 24 Jul 2008)
@@ -0,0 +1,177 @@
+// Boost detail/extended_integer.hpp header file ----------------------------//
+
+// (C) Copyright Daryle Walker 2008. Distributed under the Boost Software
+// License, Version 1.0. (See the accompanying file LICENSE_1_0.txt or a copy
+// at <http://www.boost.org/LICENSE_1_0.txt>.)
+
+// Encapsulates the double-long and __int64 type families as a single family,
+// as they are mutually exclusive.
+
+/** \file
+ \brief Common definition of extended integer types.
+
+ Instead of other Boost headers making separate \#defines for the double-long
+ and __int64 type families, since they're mutually exclusive, make a single
+ set of types and macros for the family that exists (if either).
+ */
+
+#ifndef BOOST_DETAIL_EXTENDED_INTEGER_HPP
+#define BOOST_DETAIL_EXTENDED_INTEGER_HPP
+
+#include <boost/config.hpp> // for BOOST_HAS_LONG_LONG and BOOST_HAS_MS_INT64
+
+#include <climits> // for CHAR_BIT, etc.
+
+
+namespace boost
+{
+namespace detail
+{
+
+
+// Extended integer type macro and alias definitions -----------------------//
+
+// (Unsigned) long long family
+#ifdef BOOST_HAS_LONG_LONG
+
+// Existence
+#define BOOST_HAS_XINT 1
+
+// Extents
+#ifdef ULLONG_MAX
+#define BOOST_XINT_MAX LLONG_MAX
+#define BOOST_XINT_MIN LLONG_MIN
+#define BOOST_UXINT_MAX ULLONG_MAX
+#elif defined(ULONG_LONG_MAX)
+#define BOOST_XINT_MAX LONG_LONG_MAX
+#define BOOST_XINT_MIN LONG_LONG_MIN
+#define BOOST_UXINT_MAX ULONG_LONG_MAX
+#elif defined(ULONGLONG_MAX)
+#define BOOST_XINT_MAX LONGLONG_MAX
+#define BOOST_XINT_MIN LONGLONG_MIN
+#define BOOST_UXINT_MAX ULONGLONG_MAX
+#elif defined(_LLONG_MAX) && defined(_C2)
+#define BOOST_XINT_MAX _LLONG_MAX
+#define BOOST_XINT_MIN (-_LLONG_MAX - _C2)
+#define BOOST_UXINT_MAX _ULLONG_MAX
+#else // guess
+// Sometimes we get the double-long types without the corresponding constants,
+// e.g. GCC in "-ansi" mode. In this case, we'll just have to work out the
+// values ourselves. (Here we assume a two's complement representation.)
+#define BOOST_XINT_MIN (1LL << (sizeof(::boost::long_long_type) * CHAR_BIT - 1))
+#define BOOST_XINT_MAX (~ BOOST_XINT_MIN)
+#define BOOST_UXINT_MAX (~ 0uLL)
+#endif
+
+// Types
+typedef ::boost:: long_long_type xint_t;
+typedef ::boost::ulong_long_type uxint_t;
+
+// (Unsigned) __int64 family
+#elif defined(BOOST_HAS_MS_INT64)
+
+// Existence
+#define BOOST_HAS_XINT 1
+
+// Extents
+#ifdef _UI64_MAX
+#define BOOST_XINT_MAX _I64_MAX
+#define BOOST_XINT_MIN _I64_MIN
+#define BOOST_UXINT_MAX _UI64_MAX
+#else // guess
+// The types are exactly 2's-compl. 64-bit, so we'll enter the values directly.
+#define BOOST_XINT_MAX 0x7FFFFFFFFFFFFFFFi64
+#define BOOST_XINT_MIN 0x8000000000000000i64
+#define BOOST_UXINT_MAX 0xFFFFFFFFFFFFFFFFui64
+#endif
+
+// Types
+typedef __int64 xint_t;
+typedef unsigned __int64 uxint_t;
+
+// Neither
+#else
+
+// Non-existence
+#define BOOST_HAS_XINT 0
+
+// Dummy extents
+#define BOOST_XINT_MAX LONG_MAX
+#define BOOST_XINT_MIN LONG_MIN
+#define BOOST_UXINT_MAX ULONG_MAX
+
+// Dummy types
+typedef signed long xint_t;
+typedef unsigned long uxint_t;
+
+#endif // defined(BOOST_HAS_LONG_LONG)/defined(BOOST_HAS_MS_INT64)/else
+
+/** \def BOOST_HAS_XINT
+
+ \brief Flag for extended integer types.
+
+ Indicates the presence of one of the two common extended integer type
+ families, either (<code>unsigned</code>) <code>long long</code> or
+ (<code>unsigned</code>) <code>__int64</code>. \c BOOST_HAS_XINT is \c 1 if
+ either type family is defined, and \c 0 if neither is.
+ */
+
+/** \def BOOST_XINT_MAX
+
+ \brief Maximum value for the signed extended integer type.
+
+ \pre \c BOOST_HAS_XINT is \c \#defined to be \c 1.
+
+ Macro constant representing the largest value the signed extended integer
+ type supports. Its composition may be another macro, an expression, or a
+ literal. Defaulted to \c LONG_MAX if \c BOOST_HAS_XINT is zero.
+ */
+/** \def BOOST_XINT_MIN
+
+ \brief Minimum value for the signed extended integer type.
+
+ \pre \c BOOST_HAS_XINT is \c \#defined to be \c 1.
+
+ Macro constant representing the smallest value the signed extended integer
+ type supports. Its composition may be another macro, an expression, or a
+ literal. Defaulted to \c LONG_MIN if \c BOOST_HAS_XINT is zero.
+ */
+/** \def BOOST_UXINT_MAX
+
+ \brief Maximum value for the unsigned extended integer type.
+
+ \pre \c BOOST_HAS_XINT is \c \#defined to be \c 1.
+
+ Macro constant representing the largest value the unsigned extended integer
+ type supports. Its composition may be another macro, an expression, or a
+ literal. Defaulted to \c ULONG_MAX if \c BOOST_HAS_XINT is zero. (Use
+ \c 0u for the type's minimum value.)
+ */
+
+/** \typedef signed long boost::detail::xint_t
+
+ \brief Alias for the signed extended integer type.
+
+ \pre \c BOOST_HAS_XINT is \c \#defined to be \c 1.
+
+ Alias representing the signed extended integer type, no matter which type
+ family it came from. Defaulted to <code>signed long</code> if
+ \c BOOST_HAS_XINT is zero.
+ */
+/** \typedef unsigned long ::boost::detail::uxint_t
+
+ \brief Alias for the signed extended integer type.
+
+ \pre \c BOOST_HAS_XINT is \c \#defined to be \c 1.
+
+ Alias representing the unsigned extended integer type, no matter which type
+ family it came from. Defaulted to <code>unsigned long</code> if
+ \c BOOST_HAS_XINT is zero.
+ */
+
+
+} // namespace detail
+} // namespace boost
+
+
+#endif // BOOST_DETAIL_EXTENDED_INTEGER_HPP

Modified: trunk/boost/integer.hpp
==============================================================================
--- trunk/boost/integer.hpp (original)
+++ trunk/boost/integer.hpp 2008-07-24 07:43:02 EDT (Thu, 24 Jul 2008)
@@ -29,6 +29,8 @@
 #include <boost/limits.hpp> // for std::numeric_limits
 #include <boost/utility/enable_if.hpp> // for boost::enable_if_c
 
+#include <boost/detail/extended_integer.hpp> // for BOOST_HAS_XINT, etc.
+
 #include <climits> // for UCHAR_MAX, USHRT_MAX, UINT_MAX, ULONG_MAX, etc.
 
 namespace boost
@@ -64,15 +66,9 @@
   // 3=unsigned/int, 4=(unsigned) short, 5=(un)signed char
   // no specializations for 0: requests for a type > (unsigned) (long) long are
   // in error
-#ifdef BOOST_HAS_LONG_LONG
- template<> struct int_least_helper<1, signed>
- { typedef long_long_type least; };
- template<> struct int_least_helper<1, unsigned>
- { typedef ulong_long_type least; };
-#elif defined(BOOST_HAS_MS_INT64)
- template<> struct int_least_helper<1, signed> { typedef __int64 least; };
- template<> struct int_least_helper<1, unsigned>
- { typedef unsigned __int64 least; };
+#if BOOST_HAS_XINT
+ template<> struct int_least_helper<1, signed> { typedef xint_t least; };
+ template<> struct int_least_helper<1, unsigned> { typedef uxint_t least; };
 #endif
   template<> struct int_least_helper<2, signed> { typedef long least; };
   template<> struct int_least_helper<2, unsigned>
@@ -90,7 +86,7 @@
   // category bounds
   enum
   {
-#if defined(BOOST_HAS_LONG_LONG) || defined(BOOST_HAS_MS_INT64)
+#if BOOST_HAS_XINT
       lowest_integral_rank = 1,
 #else
       lowest_integral_rank = 2,
@@ -103,12 +99,9 @@
   struct int_rank_helper
   {
       BOOST_STATIC_CONSTANT( int, mantissa = BitsIncludingSign - 1 );
-#ifdef BOOST_HAS_LONG_LONG
- BOOST_STATIC_CONSTANT( int, extended_ = (mantissa <= std::numeric_limits<
- long_long_type >::digits) );
-#elif defined(BOOST_HAS_MS_INT64)
+#if BOOST_HAS_XINT
       BOOST_STATIC_CONSTANT( int, extended_ = (mantissa <= std::numeric_limits<
- __int64 >::digits) );
+ xint_t >::digits) );
 #else
       BOOST_STATIC_CONSTANT( int, extended_ = 1 );
 #endif
@@ -122,12 +115,9 @@
   template < int Bits >
   struct uint_rank_helper
   {
-#ifdef BOOST_HAS_LONG_LONG
- BOOST_STATIC_CONSTANT( int, extended_ = (Bits <= std::numeric_limits<
- ulong_long_type >::digits) );
-#elif defined(BOOST_HAS_MS_INT64)
+#if BOOST_HAS_XINT
       BOOST_STATIC_CONSTANT( int, extended_ = (Bits <= std::numeric_limits<
- unsigned __int64 >::digits) );
+ uxint_t >::digits) );
 #else
       BOOST_STATIC_CONSTANT( int, extended_ = 1 );
 #endif
@@ -152,12 +142,9 @@
   struct uint_exact_rank_helper<std::numeric_limits< Type >::digits> \
   { BOOST_STATIC_CONSTANT( int, rank = Rank ); }
 
-#if defined(BOOST_HAS_LONG_LONG) && ((ULLONG_MAX > ULONG_MAX) || (ULONGLONG_MAX > ULONG_MAX))
- BOOST_PRIVATE_INT_EXACT_BUILDER( long_long_type, 1 );
- BOOST_PRIVATE_UINT_EXACT_BUILDER( ulong_long_type, 1 );
-#elif defined(BOOST_HAS_MS_INT64) && (0xFFFFFFFFFFFFFFFFui64 > ULONG_MAX)
- BOOST_PRIVATE_INT_EXACT_BUILDER( __int64, 1 );
- BOOST_PRIVATE_UINT_EXACT_BUILDER( unsigned __int64, 1 );
+#if BOOST_HAS_XINT && (BOOST_UXINT_MAX > ULONG_MAX)
+ BOOST_PRIVATE_INT_EXACT_BUILDER( xint_t, 1 );
+ BOOST_PRIVATE_UINT_EXACT_BUILDER( uxint_t, 1 );
 #endif
 #if ULONG_MAX > UINT_MAX
   BOOST_PRIVATE_INT_EXACT_BUILDER( long, 2 );
@@ -181,12 +168,9 @@
   template < intmax_t MaxValue >
   struct int_max_rank_helper
   {
-#ifdef BOOST_HAS_LONG_LONG
- BOOST_STATIC_CONSTANT( int, extended_ = (MaxValue <= boost::integer_traits<
- long_long_type >::const_max) );
-#elif defined(BOOST_HAS_MS_INT64)
- BOOST_STATIC_CONSTANT( int, extended_ = (MaxValue <= boost::integer_traits<
- __int64 >::const_max) );
+#if BOOST_HAS_XINT
+ BOOST_STATIC_CONSTANT( int, extended_ = (MaxValue <=
+ boost::integer_traits< xint_t >::const_max) );
 #else
       BOOST_STATIC_CONSTANT( int, extended_ = 1 );
 #endif
@@ -200,12 +184,9 @@
   template < intmax_t MinValue >
   struct int_min_rank_helper
   {
-#ifdef BOOST_HAS_LONG_LONG
- BOOST_STATIC_CONSTANT( int, extended_ = (MinValue >= boost::integer_traits<
- long_long_type >::const_min) );
-#elif defined(BOOST_HAS_MS_INT64)
- BOOST_STATIC_CONSTANT( int, extended_ = (MinValue >= boost::integer_traits<
- __int64 >::const_min) );
+#if BOOST_HAS_XINT
+ BOOST_STATIC_CONSTANT( int, extended_ = (MinValue >=
+ boost::integer_traits< xint_t >::const_min) );
 #else
       BOOST_STATIC_CONSTANT( int, extended_ = 1 );
 #endif
@@ -219,12 +200,9 @@
   template < uintmax_t Value >
   struct uint_max_rank_helper
   {
-#ifdef BOOST_HAS_LONG_LONG
+#if BOOST_HAS_XINT
       BOOST_STATIC_CONSTANT( int, extended_ = (Value <= boost::integer_traits<
- ulong_long_type >::const_max) );
-#elif defined(BOOST_HAS_MS_INT64)
- BOOST_STATIC_CONSTANT( int, extended_ = (Value <= boost::integer_traits< unsigned
- __int64 >::const_max) );
+ uxint_t >::const_max) );
 #else
       BOOST_STATIC_CONSTANT( int, extended_ = 1 );
 #endif

Modified: trunk/boost/integer_fwd.hpp
==============================================================================
--- trunk/boost/integer_fwd.hpp (original)
+++ trunk/boost/integer_fwd.hpp 2008-07-24 07:43:02 EDT (Thu, 24 Jul 2008)
@@ -16,6 +16,8 @@
 #include <boost/cstdint.hpp> // for boost::uintmax_t, intmax_t
 #include <boost/limits.hpp> // for std::numeric_limits
 
+#include <boost/detail/extended_integer.hpp> // for BOOST_HAS_XINT, etc.
+
 
 namespace boost
 {
@@ -73,12 +75,12 @@
 template < >
     class integer_traits< unsigned long >;
 
-#ifdef ULLONG_MAX
+#if !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(BOOST_NO_INT64_T) && BOOST_HAS_XINT
 template < >
- class integer_traits< ::boost::long_long_type>;
+ class integer_traits< ::boost::detail::xint_t >;
 
 template < >
- class integer_traits< ::boost::ulong_long_type >;
+ class integer_traits< ::boost::detail::uxint_t >;
 #endif
 
 

Modified: trunk/boost/integer_traits.hpp
==============================================================================
--- trunk/boost/integer_traits.hpp (original)
+++ trunk/boost/integer_traits.hpp 2008-07-24 07:43:02 EDT (Thu, 24 Jul 2008)
@@ -27,6 +27,8 @@
 #include <wchar.h>
 #endif
 
+#include <boost/detail/extended_integer.hpp> // for BOOST_HAS_XINT, etc.
+
 
 namespace boost {
 template<class T>
@@ -155,77 +157,18 @@
     public detail::integer_traits_base<unsigned long, 0, ULONG_MAX>
 { };
 
-#if !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(BOOST_NO_INT64_T)
-#if defined(ULLONG_MAX) && defined(BOOST_HAS_LONG_LONG)
-
-template<>
-class integer_traits< ::boost::long_long_type>
- : public std::numeric_limits< ::boost::long_long_type>,
- public detail::integer_traits_base< ::boost::long_long_type, LLONG_MIN, LLONG_MAX>
-{ };
-
+#if !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(BOOST_NO_INT64_T) && BOOST_HAS_XINT
 template<>
-class integer_traits< ::boost::ulong_long_type>
- : public std::numeric_limits< ::boost::ulong_long_type>,
- public detail::integer_traits_base< ::boost::ulong_long_type, 0, ULLONG_MAX>
+class integer_traits< detail::xint_t >
+ : public std::numeric_limits< detail::xint_t >,
+ public detail::integer_traits_base< detail::xint_t, BOOST_XINT_MIN, BOOST_XINT_MAX >
 { };
 
-#elif defined(ULONG_LONG_MAX) && defined(BOOST_HAS_LONG_LONG)
-
 template<>
-class integer_traits< ::boost::long_long_type> : public std::numeric_limits< ::boost::long_long_type>, public detail::integer_traits_base< ::boost::long_long_type, LONG_LONG_MIN, LONG_LONG_MAX>{ };
-template<>
-class integer_traits< ::boost::ulong_long_type>
- : public std::numeric_limits< ::boost::ulong_long_type>,
- public detail::integer_traits_base< ::boost::ulong_long_type, 0, ULONG_LONG_MAX>
+class integer_traits< detail::uxint_t >
+ : public std::numeric_limits< detail::uxint_t >,
+ public detail::integer_traits_base< detail::uxint_t, 0u, BOOST_UXINT_MAX >
 { };
-
-#elif defined(ULONGLONG_MAX) && defined(BOOST_HAS_LONG_LONG)
-
-template<>
-class integer_traits< ::boost::long_long_type>
- : public std::numeric_limits< ::boost::long_long_type>,
- public detail::integer_traits_base< ::boost::long_long_type, LONGLONG_MIN, LONGLONG_MAX>
-{ };
-
-template<>
-class integer_traits< ::boost::ulong_long_type>
- : public std::numeric_limits< ::boost::ulong_long_type>,
- public detail::integer_traits_base< ::boost::ulong_long_type, 0, ULONGLONG_MAX>
-{ };
-
-#elif defined(_LLONG_MAX) && defined(_C2) && defined(BOOST_HAS_LONG_LONG)
-
-template<>
-class integer_traits< ::boost::long_long_type>
- : public std::numeric_limits< ::boost::long_long_type>,
- public detail::integer_traits_base< ::boost::long_long_type, -_LLONG_MAX - _C2, _LLONG_MAX>
-{ };
-
-template<>
-class integer_traits< ::boost::ulong_long_type>
- : public std::numeric_limits< ::boost::ulong_long_type>,
- public detail::integer_traits_base< ::boost::ulong_long_type, 0, _ULLONG_MAX>
-{ };
-
-#elif defined(BOOST_HAS_LONG_LONG)
-//
-// we have long long but no constants, this happens for example with gcc in -ansi mode,
-// we'll just have to work out the values for ourselves (assumes 2's compliment representation):
-//
-template<>
-class integer_traits< ::boost::long_long_type>
- : public std::numeric_limits< ::boost::long_long_type>,
- public detail::integer_traits_base< ::boost::long_long_type, (1LL << (sizeof(::boost::long_long_type) - 1)), ~(1LL << (sizeof(::boost::long_long_type) - 1))>
-{ };
-
-template<>
-class integer_traits< ::boost::ulong_long_type>
- : public std::numeric_limits< ::boost::ulong_long_type>,
- public detail::integer_traits_base< ::boost::ulong_long_type, 0, ~0uLL>
-{ };
-
-#endif
 #endif
 
 } // namespace boost

Modified: trunk/boost/limits.hpp
==============================================================================
--- trunk/boost/limits.hpp (original)
+++ trunk/boost/limits.hpp 2008-07-24 07:43:02 EDT (Thu, 24 Jul 2008)
@@ -19,40 +19,29 @@
 # include <limits>
 #endif
 
+#include <boost/detail/extended_integer.hpp> // for BOOST_HAS_XINT, etc.
+
 #if (defined(BOOST_HAS_LONG_LONG) && defined(BOOST_NO_LONG_LONG_NUMERIC_LIMITS)) \
       || (defined(BOOST_HAS_MS_INT64) && defined(BOOST_NO_MS_INT64_NUMERIC_LIMITS))
 // Add missing specializations for numeric_limits:
-#ifdef BOOST_HAS_MS_INT64
-# define BOOST_LLT __int64
-# define BOOST_ULLT unsigned __int64
-#else
-# define BOOST_LLT ::boost::long_long_type
-# define BOOST_ULLT ::boost::ulong_long_type
+#if !defined(BOOST_HAS_XINT) || !(BOOST_HAS_XINT)
+#error "Shouldn't have gotten here based on preceeding preprocessor statements"
 #endif
+#define BOOST_LLT ::boost::detail::xint_t
+#define BOOST_ULLT ::boost::detail::uxint_t
 
 #include <climits> // for CHAR_BIT
 
 namespace std
 {
   template<>
- class numeric_limits<BOOST_LLT>
+ class numeric_limits< BOOST_LLT >
   {
    public:
 
       BOOST_STATIC_CONSTANT(bool, is_specialized = true);
-#ifdef BOOST_HAS_MS_INT64
- static BOOST_LLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0x8000000000000000i64; }
- static BOOST_LLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0x7FFFFFFFFFFFFFFFi64; }
-#elif defined(LLONG_MAX)
- static BOOST_LLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LLONG_MIN; }
- static BOOST_LLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LLONG_MAX; }
-#elif defined(LONGLONG_MAX)
- static BOOST_LLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LONGLONG_MIN; }
- static BOOST_LLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LONGLONG_MAX; }
-#else
- static BOOST_LLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 1LL << (sizeof(BOOST_LLT) * CHAR_BIT - 1); }
- static BOOST_LLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ~(min)(); }
-#endif
+ static BOOST_LLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return BOOST_XINT_MIN; }
+ static BOOST_LLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return BOOST_XINT_MAX; }
       BOOST_STATIC_CONSTANT(int, digits = sizeof(BOOST_LLT) * CHAR_BIT -1);
       BOOST_STATIC_CONSTANT(int, digits10 = (CHAR_BIT * sizeof (BOOST_LLT) - 1) * 301L / 1000);
       BOOST_STATIC_CONSTANT(bool, is_signed = true);
@@ -88,24 +77,13 @@
   };
 
   template<>
- class numeric_limits<BOOST_ULLT>
+ class numeric_limits< BOOST_ULLT >
   {
    public:
 
       BOOST_STATIC_CONSTANT(bool, is_specialized = true);
-#ifdef BOOST_HAS_MS_INT64
- static BOOST_ULLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0ui64; }
- static BOOST_ULLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0xFFFFFFFFFFFFFFFFui64; }
-#elif defined(ULLONG_MAX) && defined(ULLONG_MIN)
- static BOOST_ULLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULLONG_MIN; }
- static BOOST_ULLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULLONG_MAX; }
-#elif defined(ULONGLONG_MAX) && defined(ULONGLONG_MIN)
- static BOOST_ULLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULONGLONG_MIN; }
- static BOOST_ULLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULONGLONG_MAX; }
-#else
- static BOOST_ULLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0uLL; }
- static BOOST_ULLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ~0uLL; }
-#endif
+ static BOOST_ULLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return (BOOST_ULLT) 0u; }
+ static BOOST_ULLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return BOOST_UXINT_MAX; }
       BOOST_STATIC_CONSTANT(int, digits = sizeof(BOOST_LLT) * CHAR_BIT);
       BOOST_STATIC_CONSTANT(int, digits10 = (CHAR_BIT * sizeof (BOOST_LLT)) * 301L / 1000);
       BOOST_STATIC_CONSTANT(bool, is_signed = false);

Modified: trunk/libs/integer/test/integer_test.cpp
==============================================================================
--- trunk/libs/integer/test/integer_test.cpp (original)
+++ trunk/libs/integer/test/integer_test.cpp 2008-07-24 07:43:02 EDT (Thu, 24 Jul 2008)
@@ -30,6 +30,8 @@
 #include <boost/integer_traits.hpp> // for boost::integer_traits
 #include <boost/limits.hpp> // for std::numeric_limits
 
+#include <boost/detail/extended_integer.hpp> // for BOOST_HAS_XINT, etc.
+
 #include <boost/mpl/arithmetic.hpp> // for boost::mpl::plus, divides
 #include <boost/mpl/assert.hpp> // for BOOST_MPL_ASSERT_RELATION, etc.
 #include <boost/mpl/back.hpp> // for boost::mpl::back
@@ -110,10 +112,8 @@
 #if ULONG_MAX > UINT_MAX
     , unsigned long
 #endif
-#if defined(BOOST_HAS_LONG_LONG) && ((ULLONG_MAX > ULONG_MAX) || (ULONGLONG_MAX > ULONG_MAX))
- , boost::ulong_long_type
-#elif defined(BOOST_HAS_MS_INT64) && (0xFFFFFFFFFFFFFFFFui64 > ULONG_MAX)
- , unsigned __int64
+#if BOOST_HAS_XINT && (BOOST_UXINT_MAX > ULONG_MAX)
+ , boost::detail::uxint_t
 #endif
> distinct_unsigned_types;
 
@@ -210,10 +210,8 @@
 #if ULONG_MAX > UINT_MAX
     , std::numeric_limits< unsigned long >::digits
 #endif
-#if defined(BOOST_HAS_LONG_LONG) && ((ULLONG_MAX > ULONG_MAX) || (ULONGLONG_MAX > ULONG_MAX))
- , std::numeric_limits< boost::ulong_long_type >::digits
-#elif defined(BOOST_HAS_MS_INT64) && (0xFFFFFFFFFFFFFFFFui64 > ULONG_MAX)
- , std::numeric_limits< unsigned __int64 >::digits
+#if BOOST_HAS_XINT && (BOOST_UXINT_MAX > ULONG_MAX)
+ , std::numeric_limits< boost::detail::uxint_t >::digits
 #endif
 };
 


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