From 4c0690cdb031de356976e867aa0ec2bbef24b9af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Piotrowski?= Date: Tue, 9 Jul 2013 12:57:58 +0200 Subject: main/boost: add patch to fix int128 detection --- ...ost-1.54.0-Fix-macro-for-int128-detection.patch | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 main/boost/boost-1.54.0-Fix-macro-for-int128-detection.patch (limited to 'main/boost/boost-1.54.0-Fix-macro-for-int128-detection.patch') diff --git a/main/boost/boost-1.54.0-Fix-macro-for-int128-detection.patch b/main/boost/boost-1.54.0-Fix-macro-for-int128-detection.patch new file mode 100644 index 0000000000..e48936fe61 --- /dev/null +++ b/main/boost/boost-1.54.0-Fix-macro-for-int128-detection.patch @@ -0,0 +1,35 @@ +Index: boost/lexical_cast.hpp +=================================================================== +--- boost/lexical_cast.hpp (revision 84136) ++++ boost/lexical_cast.hpp (revision 84965) +@@ -70,8 +70,8 @@ + #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 +Index: libs/conversion/test/lexical_cast_integral_types_test.cpp +=================================================================== +--- libs/conversion/test/lexical_cast_integral_types_test.cpp (revision 83717) ++++ libs/conversion/test/lexical_cast_integral_types_test.cpp (revision 84965) +@@ -49,5 +49,5 @@ + #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 +@@ -445,6 +445,6 @@ + + // 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(must_owerflow_str), bad_lexical_cast); -- cgit v1.2.3