Fix macro for int128 detection (refs #8790)

[SVN r84965]
This commit is contained in:
Antony Polukhin
2013-07-07 09:51:58 +00:00
parent c3c44c208a
commit f7bd5e24c2
2 changed files with 5 additions and 5 deletions

View File

@@ -69,11 +69,11 @@
throw_exception(bad_lexical_cast(typeid(Source), typeid(Target)))
#endif
#if (defined(BOOST_LCAST_HAS_INT128) && !defined(__GNUC__)) || GCC_VERSION > 40700
// GCC 4.6 has some issues with int128 and uint128. Issues were fixed in GCC 4.7
#if defined(BOOST_HAS_INT128) && (!defined(__GNUC__) || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6))
#define BOOST_LCAST_HAS_INT128
#endif
namespace boost
{
// exception used to indicate runtime lexical_cast failure

View File

@@ -48,7 +48,7 @@
#define BOOST_LCAST_NO_WCHAR_T
#endif
#if (defined(BOOST_LCAST_HAS_INT128) && !defined(__GNUC__)) || GCC_VERSION > 40700
#if defined(BOOST_HAS_INT128) && (!defined(__GNUC__) || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6))
#define BOOST_LCAST_HAS_INT128
#endif
@@ -444,8 +444,8 @@ void test_conversion_from_to_integral_minimal()
// test_conversion_from_to_integral_for_locale
// Overflow test case from David W. Birdsall
std::string must_owerflow_str = "160000000000000000000";
std::string must_owerflow_negative_str = "-160000000000000000000";
std::string must_owerflow_str = (sizeof(T) < 16 ? "160000000000000000000" : "1600000000000000000000000000000000000000");
std::string must_owerflow_negative_str = (sizeof(T) < 16 ? "-160000000000000000000" : "-1600000000000000000000000000000000000000");
for (int i = 0; i < 15; ++i) {
BOOST_CHECK_THROW(lexical_cast<T>(must_owerflow_str), bad_lexical_cast);
BOOST_CHECK_THROW(lexical_cast<T>(must_owerflow_negative_str), bad_lexical_cast);