diff options
| author | Tobias Markmann <tm@ayena.de> | 2014-10-19 20:22:58 (GMT) |
|---|---|---|
| committer | Tobias Markmann <tm@ayena.de> | 2014-10-20 13:49:33 (GMT) |
| commit | 6b22dfcf59474dd016a0355a3102a1dd3692d92c (patch) | |
| tree | 2b1fd33be433a91e81fee84fdc2bf1b52575d934 /3rdParty/Boost/src/boost/functional | |
| parent | 38b0cb785fea8eae5e48fae56440695fdfd10ee1 (diff) | |
| download | swift-contrib-6b22dfcf59474dd016a0355a3102a1dd3692d92c.zip swift-contrib-6b22dfcf59474dd016a0355a3102a1dd3692d92c.tar.bz2 | |
Update Boost in 3rdParty to version 1.56.0.
This updates Boost in our 3rdParty directory to version 1.56.0.
Updated our update.sh script to stop on error.
Changed error reporting in SwiftTools/CrashReporter.cpp to SWIFT_LOG due to
missing include of <iostream> with newer Boost.
Change-Id: I4b35c77de951333979a524097f35f5f83d325edc
Diffstat (limited to '3rdParty/Boost/src/boost/functional')
8 files changed, 254 insertions, 188 deletions
diff --git a/3rdParty/Boost/src/boost/functional/hash/detail/container_fwd_0x.hpp b/3rdParty/Boost/src/boost/functional/hash/detail/container_fwd_0x.hpp deleted file mode 100644 index bed7730..0000000 --- a/3rdParty/Boost/src/boost/functional/hash/detail/container_fwd_0x.hpp +++ /dev/null @@ -1,29 +0,0 @@ - -// Copyright 2012 Daniel James. -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#if !defined(BOOST_DETAIL_CONTAINER_FWD_0X_HPP) -#define BOOST_DETAIL_CONTAINER_FWD_0X_HPP - -#include <boost/detail/container_fwd.hpp> - -// std::array - -#if !defined(BOOST_NO_CXX11_HDR_ARRAY) -# include <array> -#endif - -// std::tuple - -#if !defined(BOOST_NO_CXX11_HDR_TUPLE) -# include <tuple> -#endif - -// std::shared_ptr/std::unique_ptr - -#if !defined(BOOST_NO_CXX11_HDR_MEMORY) -# include <memory> -#endif - -#endif diff --git a/3rdParty/Boost/src/boost/functional/hash/detail/float_functions.hpp b/3rdParty/Boost/src/boost/functional/hash/detail/float_functions.hpp index ae03ff0..f3db52f 100644 --- a/3rdParty/Boost/src/boost/functional/hash/detail/float_functions.hpp +++ b/3rdParty/Boost/src/boost/functional/hash/detail/float_functions.hpp @@ -8,10 +8,98 @@ #include <boost/config.hpp> +#if defined(BOOST_HAS_PRAGMA_ONCE) +#pragma once +#endif + #include <boost/config/no_tr1/cmath.hpp> -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once +// Set BOOST_HASH_CONFORMANT_FLOATS to 1 for libraries known to have +// sufficiently good floating point support to not require any +// workarounds. +// +// When set to 0, the library tries to automatically +// use the best available implementation. This normally works well, but +// breaks when ambiguities are created by odd namespacing of the functions. +// +// Note that if this is set to 0, the library should still take full +// advantage of the platform's floating point support. + +#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) +# define BOOST_HASH_CONFORMANT_FLOATS 0 +#elif defined(__LIBCOMO__) +# define BOOST_HASH_CONFORMANT_FLOATS 0 +#elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER) +// Rogue Wave library: +# define BOOST_HASH_CONFORMANT_FLOATS 0 +#elif defined(_LIBCPP_VERSION) +// libc++ +# define BOOST_HASH_CONFORMANT_FLOATS 1 +#elif defined(__GLIBCPP__) || defined(__GLIBCXX__) +// GNU libstdc++ 3 +# if defined(__GNUC__) && __GNUC__ >= 4 +# define BOOST_HASH_CONFORMANT_FLOATS 1 +# else +# define BOOST_HASH_CONFORMANT_FLOATS 0 +# endif +#elif defined(__STL_CONFIG_H) +// generic SGI STL +# define BOOST_HASH_CONFORMANT_FLOATS 0 +#elif defined(__MSL_CPP__) +// MSL standard lib: +# define BOOST_HASH_CONFORMANT_FLOATS 0 +#elif defined(__IBMCPP__) +// VACPP std lib (probably conformant for much earlier version). +# if __IBMCPP__ >= 1210 +# define BOOST_HASH_CONFORMANT_FLOATS 1 +# else +# define BOOST_HASH_CONFORMANT_FLOATS 0 +# endif +#elif defined(MSIPL_COMPILE_H) +// Modena C++ standard library +# define BOOST_HASH_CONFORMANT_FLOATS 0 +#elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER) +// Dinkumware Library (this has to appear after any possible replacement libraries): +# if _CPPLIB_VER >= 405 +# define BOOST_HASH_CONFORMANT_FLOATS 1 +# else +# define BOOST_HASH_CONFORMANT_FLOATS 0 +# endif +#else +# define BOOST_HASH_CONFORMANT_FLOATS 0 #endif +#if BOOST_HASH_CONFORMANT_FLOATS + +// The standard library is known to be compliant, so don't use the +// configuration mechanism. + +namespace boost { + namespace hash_detail { + template <typename Float> + struct call_ldexp { + typedef Float float_type; + inline Float operator()(Float x, int y) const { + return std::ldexp(x, y); + } + }; + + template <typename Float> + struct call_frexp { + typedef Float float_type; + inline Float operator()(Float x, int* y) const { + return std::frexp(x, y); + } + }; + + template <typename Float> + struct select_hash_type + { + typedef Float type; + }; + } +} + +#else // BOOST_HASH_CONFORMANT_FLOATS == 0 + // The C++ standard requires that the C float functions are overloarded // for float, double and long double in the std namespace, but some of the older @@ -244,3 +332,5 @@ namespace boost } +#endif // BOOST_HASH_CONFORMANT_FLOATS + #endif diff --git a/3rdParty/Boost/src/boost/functional/hash/detail/hash_float.hpp b/3rdParty/Boost/src/boost/functional/hash/detail/hash_float.hpp index 3edc6ab..ee0ee87 100644 --- a/3rdParty/Boost/src/boost/functional/hash/detail/hash_float.hpp +++ b/3rdParty/Boost/src/boost/functional/hash/detail/hash_float.hpp @@ -7,9 +7,9 @@ #define BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_HEADER -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once +#include <boost/config.hpp> +#if defined(BOOST_HAS_PRAGMA_ONCE) +#pragma once #endif -#include <boost/config.hpp> #include <boost/functional/hash/detail/float_functions.hpp> #include <boost/functional/hash/detail/limits.hpp> @@ -74,5 +74,7 @@ namespace boost while(length >= sizeof(std::size_t)) { - hash_float_combine(seed, *(std::size_t*) ptr); + std::size_t buffer = 0; + std::memcpy(&buffer, ptr, sizeof(std::size_t)); + hash_float_combine(seed, buffer); length -= sizeof(std::size_t); ptr += sizeof(std::size_t); @@ -89,13 +91,19 @@ namespace boost } + template <typename Float, unsigned digits, unsigned max_exponent> + struct enable_binary_hash + { + BOOST_STATIC_CONSTANT(bool, value = + std::numeric_limits<Float>::is_iec559 && + std::numeric_limits<Float>::digits == digits && + std::numeric_limits<Float>::radix == 2 && + std::numeric_limits<Float>::max_exponent == max_exponent); + }; + template <typename Float> inline std::size_t float_hash_impl(Float v, BOOST_DEDUCED_TYPENAME boost::enable_if_c< - std::numeric_limits<Float>::is_iec559 && - std::numeric_limits<Float>::digits == 24 && - std::numeric_limits<Float>::radix == 2 && - std::numeric_limits<Float>::max_exponent == 128, - int>::type - ) + enable_binary_hash<Float, 24, 128>::value, + std::size_t>::type) { return hash_binary((char*) &v, 4); @@ -106,10 +114,6 @@ namespace boost inline std::size_t float_hash_impl(Float v, BOOST_DEDUCED_TYPENAME boost::enable_if_c< - std::numeric_limits<Float>::is_iec559 && - std::numeric_limits<Float>::digits == 53 && - std::numeric_limits<Float>::radix == 2 && - std::numeric_limits<Float>::max_exponent == 1024, - int>::type - ) + enable_binary_hash<Float, 53, 1024>::value, + std::size_t>::type) { return hash_binary((char*) &v, 8); @@ -119,10 +123,6 @@ namespace boost inline std::size_t float_hash_impl(Float v, BOOST_DEDUCED_TYPENAME boost::enable_if_c< - std::numeric_limits<Float>::is_iec559 && - std::numeric_limits<Float>::digits == 64 && - std::numeric_limits<Float>::radix == 2 && - std::numeric_limits<Float>::max_exponent == 16384, - int>::type - ) + enable_binary_hash<Float, 64, 16384>::value, + std::size_t>::type) { return hash_binary((char*) &v, 10); @@ -132,10 +132,6 @@ namespace boost inline std::size_t float_hash_impl(Float v, BOOST_DEDUCED_TYPENAME boost::enable_if_c< - std::numeric_limits<Float>::is_iec559 && - std::numeric_limits<Float>::digits == 113 && - std::numeric_limits<Float>::radix == 2 && - std::numeric_limits<Float>::max_exponent == 16384, - int>::type - ) + enable_binary_hash<Float, 113, 16384>::value, + std::size_t>::type) { return hash_binary((char*) &v, 16); @@ -211,6 +207,13 @@ namespace boost inline std::size_t float_hash_value(T v) { +#if defined(fpclassify) + switch (fpclassify(v)) +#elif BOOST_HASH_CONFORMANT_FLOATS + switch (std::fpclassify(v)) +#else using namespace std; - switch (fpclassify(v)) { + switch (fpclassify(v)) +#endif + { case FP_ZERO: return 0; diff --git a/3rdParty/Boost/src/boost/functional/hash/detail/limits.hpp b/3rdParty/Boost/src/boost/functional/hash/detail/limits.hpp index f5b520e..4a971a6 100644 --- a/3rdParty/Boost/src/boost/functional/hash/detail/limits.hpp +++ b/3rdParty/Boost/src/boost/functional/hash/detail/limits.hpp @@ -10,6 +10,7 @@ #define BOOST_FUNCTIONAL_HASH_DETAIL_LIMITS_HEADER -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once +#include <boost/config.hpp> +#if defined(BOOST_HAS_PRAGMA_ONCE) +#pragma once #endif diff --git a/3rdParty/Boost/src/boost/functional/hash/extensions.hpp b/3rdParty/Boost/src/boost/functional/hash/extensions.hpp index 4358736..eafaefe 100644 --- a/3rdParty/Boost/src/boost/functional/hash/extensions.hpp +++ b/3rdParty/Boost/src/boost/functional/hash/extensions.hpp @@ -14,6 +14,11 @@ #define BOOST_FUNCTIONAL_HASH_EXTENSIONS_HPP +#include <boost/config.hpp> +#if defined(BOOST_HAS_PRAGMA_ONCE) +#pragma once +#endif + #include <boost/functional/hash/hash.hpp> -#include <boost/functional/hash/detail/container_fwd_0x.hpp> +#include <boost/detail/container_fwd.hpp> #include <boost/utility/enable_if.hpp> #include <boost/static_assert.hpp> @@ -21,14 +26,18 @@ #include <boost/preprocessor/repetition/enum_params.hpp> -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once +#if !defined(BOOST_NO_CXX11_HDR_ARRAY) +# include <array> #endif -#if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) -#include <boost/type_traits/is_array.hpp> +#if !defined(BOOST_NO_CXX11_HDR_TUPLE) +# include <tuple> #endif -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) -#include <boost/type_traits/is_const.hpp> +#if !defined(BOOST_NO_CXX11_HDR_MEMORY) +# include <memory> +#endif + +#if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) +#include <boost/type_traits/is_array.hpp> #endif @@ -150,5 +159,5 @@ namespace boost } -#if !defined(BOOST_NO_VARIADIC_TEMPLATES) +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) template <typename... T> inline std::size_t hash_value(std::tuple<T...> const& v) @@ -221,9 +230,5 @@ namespace boost struct inner { -#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) static std::size_t call(Array const& v) -#else - static std::size_t call(Array& v) -#endif { const int size = sizeof(v) / sizeof(*v); @@ -287,6 +292,4 @@ namespace boost struct hash_impl; -#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) - template <> struct hash_impl<false> @@ -309,56 +312,4 @@ namespace boost }; }; - -#else // Visual C++ 6.5 - - // Visual C++ 6.5 has problems with nested member functions and - // applying const to const types in templates. So we get this: - - template <bool IsConst> - struct hash_impl_msvc - { - template <class T> - struct inner - : public std::unary_function<T, std::size_t> - { - std::size_t operator()(T const& val) const - { - return hash_detail::call_hash<T const>::call(val); - } - - std::size_t operator()(T& val) const - { - return hash_detail::call_hash<T>::call(val); - } - }; - }; - - template <> - struct hash_impl_msvc<true> - { - template <class T> - struct inner - : public std::unary_function<T, std::size_t> - { - std::size_t operator()(T& val) const - { - return hash_detail::call_hash<T>::call(val); - } - }; - }; - - template <class T> - struct hash_impl_msvc2 - : public hash_impl_msvc<boost::is_const<T>::value> - ::BOOST_NESTED_TEMPLATE inner<T> {}; - - template <> - struct hash_impl<false> - { - template <class T> - struct inner : public hash_impl_msvc2<T> {}; - }; - -#endif // Visual C++ 6.5 } #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION diff --git a/3rdParty/Boost/src/boost/functional/hash/hash.hpp b/3rdParty/Boost/src/boost/functional/hash/hash.hpp index 647fd68..3e5ab5b 100644 --- a/3rdParty/Boost/src/boost/functional/hash/hash.hpp +++ b/3rdParty/Boost/src/boost/functional/hash/hash.hpp @@ -1,4 +1,4 @@ -// Copyright 2005-2009 Daniel James. +// Copyright 2005-2014 Daniel James. // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,4 +7,10 @@ // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf // issue 6.18. +// +// This also contains public domain code from MurmurHash. From the +// MurmurHash header: + +// MurmurHash3 was written by Austin Appleby, and is placed in the public +// domain. The author hereby disclaims copyright to this source code. #if !defined(BOOST_FUNCTIONAL_HASH_HASH_HPP) @@ -17,5 +23,7 @@ #include <boost/limits.hpp> #include <boost/type_traits/is_enum.hpp> +#include <boost/type_traits/is_integral.hpp> #include <boost/utility/enable_if.hpp> +#include <boost/cstdint.hpp> #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) @@ -27,4 +35,15 @@ #endif +#if defined(BOOST_MSVC) +#pragma warning(push) + +#if BOOST_MSVC >= 1400 +#pragma warning(disable:6295) // Ill-defined for-loop : 'unsigned int' values + // are always of range '0' to '4294967295'. + // Loop executes infinitely. +#endif + +#endif + #if BOOST_WORKAROUND(__GNUC__, < 3) \ && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) @@ -34,4 +53,10 @@ #endif +#if defined(_MSC_VER) +# define BOOST_FUNCTIONAL_HASH_ROTL32(x, r) _rotl(x,r) +#else +# define BOOST_FUNCTIONAL_HASH_ROTL32(x, r) (x << r) | (x >> (32 - r)) +#endif + namespace boost { @@ -41,6 +66,6 @@ namespace boost template <typename T> struct basic_numbers {}; - template <typename T> struct long_numbers {}; - template <typename T> struct ulong_numbers {}; + template <typename T> struct long_numbers; + template <typename T> struct ulong_numbers; template <typename T> struct float_numbers {}; @@ -71,4 +96,12 @@ namespace boost #endif + // long_numbers is defined like this to allow for separate + // specialization for long_long and int128_type, in case + // they conflict. + template <typename T> struct long_numbers2 {}; + template <typename T> struct ulong_numbers2 {}; + template <typename T> struct long_numbers : long_numbers2<T> {}; + template <typename T> struct ulong_numbers : ulong_numbers2<T> {}; + #if !defined(BOOST_NO_LONG_LONG) template <> struct long_numbers<boost::long_long_type> : @@ -78,4 +111,11 @@ namespace boost #endif +#if defined(BOOST_HAS_INT128) + template <> struct long_numbers2<boost::int128_type> : + boost::hash_detail::enable_hash_value {}; + template <> struct ulong_numbers2<boost::uint128_type> : + boost::hash_detail::enable_hash_value {}; +#endif + template <> struct float_numbers<float> : boost::hash_detail::enable_hash_value {}; @@ -95,5 +135,5 @@ namespace boost template <typename T> typename boost::enable_if<boost::is_enum<T>, std::size_t>::type - hash_value(T); + hash_value(T); #if !BOOST_WORKAROUND(__DMC__, <= 0x848) @@ -166,4 +206,49 @@ namespace boost return seed; } + + template <typename SizeT> + inline void hash_combine_impl(SizeT& seed, SizeT value) + { + seed ^= value + 0x9e3779b9 + (seed<<6) + (seed>>2); + } + + template <typename SizeT> + inline void hash_combine_impl(boost::uint32_t& h1, + boost::uint32_t k1) + { + const uint32_t c1 = 0xcc9e2d51; + const uint32_t c2 = 0x1b873593; + + k1 *= c1; + k1 = BOOST_FUNCTIONAL_HASH_ROTL32(k1,15); + k1 *= c2; + + h1 ^= k1; + h1 = BOOST_FUNCTIONAL_HASH_ROTL32(h1,13); + h1 = h1*5+0xe6546b64; + } + + +// Don't define 64-bit hash combine on platforms with 64 bit integers, +// and also not for 32-bit gcc as it warns about the 64-bit constant. +#if !defined(BOOST_NO_INT64_T) && \ + !(defined(__GNUC__) && ULONG_MAX == 0xffffffff) + + template <typename SizeT> + inline void hash_combine_impl(boost::uint64_t& h, + boost::uint64_t k) + { + const uint64_t m = UINT64_C(0xc6a4a7935bd1e995); + const int r = 47; + + k *= m; + k ^= k >> r; + k *= m; + + h ^= k; + h *= m; + } + +#endif // BOOST_NO_INT64_T } @@ -188,7 +273,7 @@ namespace boost template <typename T> typename boost::enable_if<boost::is_enum<T>, std::size_t>::type - hash_value(T v) + hash_value(T v) { - return static_cast<std::size_t>(v); + return static_cast<std::size_t>(v); } @@ -222,14 +307,9 @@ namespace boost #endif -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - template <class T> - inline void hash_combine(std::size_t& seed, T& v) -#else template <class T> inline void hash_combine(std::size_t& seed, T const& v) -#endif { boost::hash<T> hasher; - seed ^= hasher(v) + 0x9e3779b9 + (seed<<6) + (seed>>2); + return boost::hash_detail::hash_combine_impl(seed, hasher(v)); } @@ -336,5 +416,4 @@ namespace boost // These are undefined later. -#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) #define BOOST_HASH_SPECIALIZE(type) \ template <> struct hash<type> \ @@ -356,43 +435,4 @@ namespace boost } \ }; -#else -#define BOOST_HASH_SPECIALIZE(type) \ - template <> struct hash<type> \ - : public std::unary_function<type, std::size_t> \ - { \ - std::size_t operator()(type v) const \ - { \ - return boost::hash_value(v); \ - } \ - }; \ - \ - template <> struct hash<const type> \ - : public std::unary_function<const type, std::size_t> \ - { \ - std::size_t operator()(const type v) const \ - { \ - return boost::hash_value(v); \ - } \ - }; - -#define BOOST_HASH_SPECIALIZE_REF(type) \ - template <> struct hash<type> \ - : public std::unary_function<type, std::size_t> \ - { \ - std::size_t operator()(type const& v) const \ - { \ - return boost::hash_value(v); \ - } \ - }; \ - \ - template <> struct hash<const type> \ - : public std::unary_function<const type, std::size_t> \ - { \ - std::size_t operator()(type const& v) const \ - { \ - return boost::hash_value(v); \ - } \ - }; -#endif BOOST_HASH_SPECIALIZE(bool) @@ -424,4 +464,9 @@ namespace boost #endif +#if defined(BOOST_HAS_INT128) + BOOST_HASH_SPECIALIZE(boost::int128_type) + BOOST_HASH_SPECIALIZE(boost::uint128_type) +#endif + #if !defined(BOOST_NO_CXX11_HDR_TYPEINDEX) BOOST_HASH_SPECIALIZE(std::type_index) @@ -497,4 +542,9 @@ namespace boost #undef BOOST_HASH_CHAR_TRAITS +#undef BOOST_FUNCTIONAL_HASH_ROTL32 + +#if defined(BOOST_MSVC) +#pragma warning(pop) +#endif #endif // BOOST_FUNCTIONAL_HASH_HASH_HPP diff --git a/3rdParty/Boost/src/boost/functional/hash/hash_fwd.hpp b/3rdParty/Boost/src/boost/functional/hash/hash_fwd.hpp index 1d51b07..01fe012 100644 --- a/3rdParty/Boost/src/boost/functional/hash/hash_fwd.hpp +++ b/3rdParty/Boost/src/boost/functional/hash/hash_fwd.hpp @@ -11,9 +11,9 @@ #define BOOST_FUNCTIONAL_HASH_FWD_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once +#include <boost/config.hpp> +#if defined(BOOST_HAS_PRAGMA_ONCE) +#pragma once #endif -#include <boost/config.hpp> #include <cstddef> #include <boost/detail/workaround.hpp> @@ -23,9 +23,5 @@ namespace boost template <class T> struct hash; -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - template <class T> void hash_combine(std::size_t& seed, T& v); -#else template <class T> void hash_combine(std::size_t& seed, T const& v); -#endif template <class It> std::size_t hash_range(It, It); diff --git a/3rdParty/Boost/src/boost/functional/hash_fwd.hpp b/3rdParty/Boost/src/boost/functional/hash_fwd.hpp index b640988..eea9073 100644 --- a/3rdParty/Boost/src/boost/functional/hash_fwd.hpp +++ b/3rdParty/Boost/src/boost/functional/hash_fwd.hpp @@ -4,4 +4,8 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#include <boost/functional/hash/hash_fwd.hpp> +#include <boost/config.hpp> +#if defined(BOOST_HAS_PRAGMA_ONCE) +#pragma once +#endif +#include <boost/functional/hash/hash_fwd.hpp> |
Swift