diff --git a/include/boost/integer.hpp b/include/boost/integer.hpp index f82e1b3..d9215bc 100644 --- a/include/boost/integer.hpp +++ b/include/boost/integer.hpp @@ -94,8 +94,8 @@ namespace boost (defined(ULONG_LONG_MAX) && (ULONG_LONG_MAX != ULONG_MAX)) ||\ (defined(ULONGLONG_MAX) && (ULONGLONG_MAX != ULONG_MAX)) ||\ (defined(_ULLONG_MAX) && (_ULLONG_MAX != ULONG_MAX))) - template <> struct exact_signed_base_helper { typedef long long exact; }; - template <> struct exact_unsigned_base_helper { typedef unsigned long long exact; }; + template <> struct exact_signed_base_helper { typedef boost::long_long_type exact; }; + template <> struct exact_unsigned_base_helper { typedef boost::ulong_long_type exact; }; #endif @@ -194,10 +194,20 @@ namespace boost #if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) template< boost::ulong_long_type MaxValue > // minimum value to require support #else - template< long MaxValue > // minimum value to require support + template< unsigned long MaxValue > // minimum value to require support #endif struct uint_value_t { +#if (defined(__BORLANDC__) || defined(__CODEGEAR__)) && defined(BOOST_NO_INTEGRAL_INT64_T) + // It's really not clear why this workaround should be needed... shrug I guess! JM + BOOST_STATIC_CONSTANT(unsigned, which = + 6 + + (MaxValue <= ::boost::integer_traits::const_max) + + (MaxValue <= ::boost::integer_traits::const_max) + + (MaxValue <= ::boost::integer_traits::const_max) + + (MaxValue <= ::boost::integer_traits::const_max)); + typedef typename detail::int_least_helper< ::boost::uint_value_t::which>::least least; +#else typedef typename detail::int_least_helper < 5 + @@ -211,6 +221,7 @@ namespace boost (MaxValue <= ::boost::integer_traits::const_max) + (MaxValue <= ::boost::integer_traits::const_max) >::least least; +#endif typedef typename int_fast_t::type fast; }; diff --git a/include/boost/integer_fwd.hpp b/include/boost/integer_fwd.hpp index ab39561..01b0a08 100644 --- a/include/boost/integer_fwd.hpp +++ b/include/boost/integer_fwd.hpp @@ -114,7 +114,7 @@ template< int Bits > #if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) template< boost::ulong_long_type MaxValue > // maximum value to require support #else - template< long MaxValue > // maximum value to require support + template< unsigned long MaxValue > // maximum value to require support #endif struct uint_value_t; diff --git a/test/cstdint_test.cpp b/test/cstdint_test.cpp index 9c40d3d..c329e8f 100644 --- a/test/cstdint_test.cpp +++ b/test/cstdint_test.cpp @@ -12,6 +12,12 @@ // 12 Nov 00 Adapted to merged // 23 Sep 00 Added INTXX_C constant macro support + int64_t support (John Maddock). // 28 Jun 00 Initial version + +#if defined(__GNUC__) && (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) +// We can't suppress this warning on the command line as not all GCC versions support -Wno-type-limits : +#pragma GCC diagnostic ignored "-Wtype-limits" +#endif + #define __STDC_CONSTANT_MACROS #include #include diff --git a/test/integer_test.cpp b/test/integer_test.cpp index 4e4f8c7..bef0308 100644 --- a/test/integer_test.cpp +++ b/test/integer_test.cpp @@ -165,8 +165,8 @@ void do_test_bits<-1>() // Nothing to do here!! } -template -void test_min_max_type(Value val) +template +void test_min_max_type(Expected val) { typedef typename Traits::least least_type; typedef typename Traits::fast fast_type;