Add initial support for __int128 to Config and TypeTraits

[SVN r81064]
This commit is contained in:
John Maddock
2012-10-25 12:21:19 +00:00
parent a75ba5f2af
commit e6314963a3
8 changed files with 66 additions and 0 deletions

View File

@ -68,6 +68,11 @@ BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral, ::boost::long_long_type,true)
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int64,true)
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int64,true)
#endif
#ifdef BOOST_HAS_INT128
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,boost::int128_type,true)
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,boost::uint128_type,true)
#endif
#endif // non-CodeGear implementation

View File

@ -72,7 +72,15 @@ struct make_signed_imp
is_same<t_no_cv, unsigned long>,
long,
#if defined(BOOST_HAS_LONG_LONG)
#ifdef BOOST_HAS_INT128
typename mpl::if_c<
sizeof(t_no_cv) == sizeof(boost::long_long_type),
boost::long_long_type,
boost::int128_type
>::type
#else
boost::long_long_type
#endif
#elif defined(BOOST_HAS_MS_INT64)
__int64
#else
@ -96,7 +104,15 @@ struct make_signed_imp
sizeof(t_no_cv) == sizeof(unsigned long),
long,
#if defined(BOOST_HAS_LONG_LONG)
#ifdef BOOST_HAS_INT128
typename mpl::if_c<
sizeof(t_no_cv) == sizeof(boost::long_long_type),
boost::long_long_type,
boost::int128_type
>::type
#else
boost::long_long_type
#endif
#elif defined(BOOST_HAS_MS_INT64)
__int64
#else

View File

@ -72,7 +72,15 @@ struct make_unsigned_imp
is_same<t_no_cv, long>,
unsigned long,
#if defined(BOOST_HAS_LONG_LONG)
#ifdef BOOST_HAS_INT128
typename mpl::if_c<
sizeof(t_no_cv) == sizeof(boost::ulong_long_type),
boost::ulong_long_type,
boost::uint128_type
>::type
#else
boost::ulong_long_type
#endif
#elif defined(BOOST_HAS_MS_INT64)
unsigned __int64
#else
@ -96,7 +104,15 @@ struct make_unsigned_imp
sizeof(t_no_cv) == sizeof(unsigned long),
unsigned long,
#if defined(BOOST_HAS_LONG_LONG)
#ifdef BOOST_HAS_INT128
typename mpl::if_c<
sizeof(t_no_cv) == sizeof(boost::ulong_long_type),
boost::ulong_long_type,
boost::uint128_type
>::type
#else
boost::ulong_long_type
#endif
#elif defined(BOOST_HAS_MS_INT64)
unsigned __int64
#else

View File

@ -112,6 +112,18 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int64 const volatile>::value,
#endif
#ifdef BOOST_HAS_INT128
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<boost::uint128_type>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<boost::int128_type>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<boost::uint128_type const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<boost::int128_type const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<boost::uint128_type volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<boost::int128_type volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<boost::uint128_type const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<boost::int128_type const volatile>::value, true);
#endif
//
// cases that should not be true:
//

View File

@ -31,6 +31,10 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<int&&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<int*>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<int[2]>::value, false);
#ifdef BOOST_HAS_INT128
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<boost::int128_type>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed<boost::uint128_type>::value, false);
#endif
TT_TEST_END

View File

@ -31,6 +31,11 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<unsigned&&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<unsigned*>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<unsigned[2]>::value, false);
#ifdef BOOST_HAS_INT128
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<boost::int128_type>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned<boost::uint128_type>::value, true);
#endif
TT_TEST_END

View File

@ -95,6 +95,10 @@ BOOST_CHECK_TYPE(::tt::make_signed<const volatile boost::ulong_long_type>::type,
#elif defined(BOOST_HAS_MS_INT64)
BOOST_CHECK_TYPE(::tt::make_signed<const volatile unsigned __int64>::type, const volatile __int64);
#endif
#ifdef BOOST_HAS_INT128
BOOST_CHECK_TYPE(::tt::make_signed<boost::int128_type>::type, boost::int128_type);
BOOST_CHECK_TYPE(::tt::make_signed<boost::uint128_type>::type, boost::int128_type);
#endif
// character types:
BOOST_CHECK_TYPE(::tt::make_signed<char>::type, signed char);

View File

@ -95,6 +95,10 @@ BOOST_CHECK_TYPE(::tt::make_unsigned<const volatile boost::ulong_long_type>::typ
#elif defined(BOOST_HAS_MS_INT64)
BOOST_CHECK_TYPE(::tt::make_unsigned<const volatile unsigned __int64>::type, const volatile unsigned __int64);
#endif
#ifdef BOOST_HAS_INT128
BOOST_CHECK_TYPE(::tt::make_unsigned<boost::int128_type>::type, boost::uint128_type);
BOOST_CHECK_TYPE(::tt::make_unsigned<boost::uint128_type>::type, boost::uint128_type);
#endif
// character types:
BOOST_CHECK_TYPE(::tt::make_unsigned<char>::type, unsigned char);