7a5bc98bdd
- fix build of libzypp - patch from boost's track - added patches: * boost-1.54-change85160.patch OBS-URL: https://build.opensuse.org/request/show/212830 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/boost?expand=0&rev=115
238 lines
8.4 KiB
Diff
238 lines
8.4 KiB
Diff
Index: boost/lexical_cast.hpp
|
|
===================================================================
|
|
--- boost/lexical_cast.hpp (revision 84183)
|
|
+++ boost/lexical_cast.hpp (revision 85160)
|
|
@@ -69,9 +69,4 @@
|
|
throw_exception(bad_lexical_cast(typeid(Source), typeid(Target)))
|
|
#endif
|
|
-
|
|
-#if (defined(BOOST_LCAST_HAS_INT128) && !defined(__GNUC__)) || GCC_VERSION > 40700
|
|
-#define BOOST_LCAST_HAS_INT128
|
|
-#endif
|
|
-
|
|
|
|
namespace boost
|
|
@@ -317,5 +312,5 @@
|
|
#endif
|
|
|
|
-#ifdef BOOST_LCAST_HAS_INT128
|
|
+#ifdef BOOST_HAS_INT128
|
|
template <> struct stream_char_common< boost::int128_type >: public boost::mpl::identity< char > {};
|
|
template <> struct stream_char_common< boost::uint128_type >: public boost::mpl::identity< char > {};
|
|
@@ -614,5 +609,5 @@
|
|
BOOST_LCAST_DEF( __int64)
|
|
#endif
|
|
-#ifdef BOOST_LCAST_HAS_INT128
|
|
+#ifdef BOOST_HAS_INT128
|
|
BOOST_LCAST_DEF(boost::int128_type)
|
|
BOOST_LCAST_DEF(boost::uint128_type)
|
|
@@ -880,4 +875,13 @@
|
|
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
|
|
BOOST_STATIC_ASSERT(!std::numeric_limits<T>::is_signed);
|
|
+
|
|
+ // GCC when used with flag -std=c++0x may not have std::numeric_limits
|
|
+ // specializations for __int128 and unsigned __int128 types.
|
|
+ // Try compilation with -std=gnu++0x or -std=gnu++11.
|
|
+ //
|
|
+ // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40856
|
|
+ BOOST_STATIC_ASSERT_MSG(std::numeric_limits<T>::is_specialized,
|
|
+ "std::numeric_limits are not specialized for integral type passed to boost::lexical_cast"
|
|
+ );
|
|
#endif
|
|
CharT const czero = lcast_char_constants<CharT>::zero;
|
|
@@ -1828,5 +1832,5 @@
|
|
#endif
|
|
|
|
-#ifdef BOOST_LCAST_HAS_INT128
|
|
+#ifdef BOOST_HAS_INT128
|
|
bool operator<<(const boost::uint128_type& n) { start = lcast_put_unsigned<Traits>(n, finish); return true; }
|
|
bool operator<<(const boost::int128_type& n) { return shl_signed(n); }
|
|
@@ -2040,5 +2044,5 @@
|
|
#endif
|
|
|
|
-#ifdef BOOST_LCAST_HAS_INT128
|
|
+#ifdef BOOST_HAS_INT128
|
|
bool operator>>(boost::uint128_type& output) { return shr_unsigned(output); }
|
|
bool operator>>(boost::int128_type& output) { return shr_signed(output); }
|
|
@@ -2554,5 +2558,5 @@
|
|
}
|
|
#endif
|
|
-#ifndef BOOST_NO_CHAR16_T
|
|
+#ifndef BOOST_NO_CXX11_CHAR16_T
|
|
template <typename Target>
|
|
inline Target lexical_cast(const char16_t* chars, std::size_t count)
|
|
@@ -2563,5 +2567,5 @@
|
|
}
|
|
#endif
|
|
-#ifndef BOOST_NO_CHAR32_T
|
|
+#ifndef BOOST_NO_CXX11_CHAR32_T
|
|
template <typename Target>
|
|
inline Target lexical_cast(const char32_t* chars, std::size_t count)
|
|
@@ -2720,5 +2724,4 @@
|
|
#undef BOOST_LCAST_THROW_BAD_CAST
|
|
#undef BOOST_LCAST_NO_WCHAR_T
|
|
-#undef BOOST_LCAST_HAS_INT128
|
|
|
|
#endif // BOOST_LEXICAL_CAST_INCLUDED
|
|
Index: libs/conversion/test/lexical_cast_integral_types_test.cpp
|
|
===================================================================
|
|
--- libs/conversion/test/lexical_cast_integral_types_test.cpp (revision 83764)
|
|
+++ libs/conversion/test/lexical_cast_integral_types_test.cpp (revision 85160)
|
|
@@ -49,8 +49,4 @@
|
|
#endif
|
|
|
|
-#if (defined(BOOST_LCAST_HAS_INT128) && !defined(__GNUC__)) || GCC_VERSION > 40700
|
|
-#define BOOST_LCAST_HAS_INT128
|
|
-#endif
|
|
-
|
|
// Test all 65536 values if true:
|
|
bool const lcast_test_small_integral_types_completely = false;
|
|
@@ -76,5 +72,5 @@
|
|
void test_conversion_from_to_ulonglong();
|
|
#endif
|
|
-#ifdef BOOST_LCAST_HAS_INT128
|
|
+#ifdef BOOST_HAS_INT128
|
|
void test_conversion_from_to_int128();
|
|
void test_conversion_from_to_uint128();
|
|
@@ -100,5 +96,5 @@
|
|
suite->add(BOOST_TEST_CASE(&test_conversion_from_to_ulonglong));
|
|
#endif
|
|
-#ifdef BOOST_LCAST_HAS_INT128
|
|
+#ifdef BOOST_HAS_INT128
|
|
suite->add(BOOST_TEST_CASE(&test_conversion_from_to_int128));
|
|
suite->add(BOOST_TEST_CASE(&test_conversion_from_to_uint128));
|
|
@@ -445,6 +441,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<T>(must_owerflow_str), bad_lexical_cast);
|
|
@@ -558,13 +554,32 @@
|
|
|
|
|
|
-#ifdef BOOST_LCAST_HAS_INT128
|
|
+#ifdef BOOST_HAS_INT128
|
|
+
|
|
+template <bool Specialized, class T>
|
|
+struct test_if_specialized {
|
|
+ static void test() {}
|
|
+};
|
|
+
|
|
+template <class T>
|
|
+struct test_if_specialized<true, T> {
|
|
+ static void test() {
|
|
+ test_conversion_from_to_integral_minimal<T>();
|
|
+ }
|
|
+};
|
|
+
|
|
void test_conversion_from_to_int128()
|
|
{
|
|
- test_conversion_from_to_integral_minimal<boost::int128_type>();
|
|
+ test_if_specialized<
|
|
+ std::numeric_limits<boost::int128_type>::is_specialized,
|
|
+ boost::int128_type
|
|
+ >::test();
|
|
}
|
|
|
|
void test_conversion_from_to_uint128()
|
|
{
|
|
- test_conversion_from_to_integral_minimal<boost::uint128_type>();
|
|
+ test_if_specialized<
|
|
+ std::numeric_limits<boost::int128_type>::is_specialized,
|
|
+ boost::uint128_type
|
|
+ >::test();
|
|
}
|
|
#endif
|
|
@@ -603,5 +618,5 @@
|
|
#endif
|
|
|
|
-#ifdef BOOST_LCAST_HAS_INT128
|
|
+#ifdef BOOST_HAS_INT128
|
|
test_integral_conversions_on_min_max_impl<boost::int128_type>();
|
|
#endif
|
|
Index: libs/conversion/test/Jamfile.v2
|
|
===================================================================
|
|
--- libs/conversion/test/Jamfile.v2 (revision 83689)
|
|
+++ libs/conversion/test/Jamfile.v2 (revision 85160)
|
|
@@ -1,4 +1,4 @@
|
|
# Copyright (C) 2001-2003 Douglas Gregor
|
|
-# Copyright (C) 2011-2012 Antony Polukhin
|
|
+# Copyright (C) 2011-2013 Antony Polukhin
|
|
#
|
|
# Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
@@ -16,4 +16,9 @@
|
|
<toolset>gcc-4.6:<cxxflags>-ftrapv
|
|
<toolset>clang:<cxxflags>-ftrapv
|
|
+ # default to all warnings on:
|
|
+ <warnings>all
|
|
+ # set warnings as errors for those compilers we know we get warning free:
|
|
+ <toolset>gcc:<cxxflags>-Wextra
|
|
+ <toolset>gcc:<cxxflags>-Wno-uninitialized
|
|
;
|
|
|
|
Index: libs/conversion/test/implicit_cast_fail.cpp
|
|
===================================================================
|
|
--- libs/conversion/test/implicit_cast_fail.cpp (revision 79364)
|
|
+++ libs/conversion/test/implicit_cast_fail.cpp (revision 85160)
|
|
@@ -20,5 +20,7 @@
|
|
{
|
|
foo x = implicit_cast<foo>("foobar");
|
|
- (void)x; // warning suppression.
|
|
+ (void)x; // warning suppression.
|
|
+ BOOST_CHECK(false); // suppressing warning about 'boost::unit_test::{anonymous}::unit_test_log' defined but not used
|
|
return 0;
|
|
}
|
|
+
|
|
Index: libs/conversion/test/lexical_cast_to_pointer_test.cpp
|
|
===================================================================
|
|
--- libs/conversion/test/lexical_cast_to_pointer_test.cpp (revision 83689)
|
|
+++ libs/conversion/test/lexical_cast_to_pointer_test.cpp (revision 85160)
|
|
@@ -18,4 +18,6 @@
|
|
{
|
|
boost::lexical_cast<char*>("Hello");
|
|
+ BOOST_CHECK(false); // suppressing warning about 'boost::unit_test::{anonymous}::unit_test_log' defined but not used
|
|
return 0;
|
|
}
|
|
+
|
|
Index: libs/conversion/index.html
|
|
===================================================================
|
|
--- libs/conversion/index.html (revision 73851)
|
|
+++ libs/conversion/index.html (revision 85160)
|
|
@@ -7,4 +7,11 @@
|
|
<meta name="ProgId" content="FrontPage.Editor.Document">
|
|
<title>Boost Conversion Library</title>
|
|
+<style>
|
|
+ .copyright
|
|
+ {
|
|
+ color: #666666;
|
|
+ font-size: small;
|
|
+ }
|
|
+</style>
|
|
</head>
|
|
|
|
@@ -33,5 +40,9 @@
|
|
S-Format="%d %B, %Y" startspan -->June 23, 2005<!--webbot bot="Timestamp" endspan i-checksum="30348" -->
|
|
</p>
|
|
-
|
|
+<p class="copyright">
|
|
+ Copyright 2001 Beman Dawes.
|
|
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
+ file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)
|
|
+</p>
|
|
</body>
|
|
|
|
Index: libs/conversion/numeric_cast_test.cpp
|
|
===================================================================
|
|
--- libs/conversion/numeric_cast_test.cpp (revision 80409)
|
|
+++ libs/conversion/numeric_cast_test.cpp (revision 85160)
|
|
@@ -49,5 +49,5 @@
|
|
signed char c = 0;
|
|
|
|
- c = large_value; // see if compiler generates warning
|
|
+ c = static_cast<signed char>(large_value);
|
|
|
|
c = numeric_cast<signed char>( small_value );
|