summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-11-24 20:33:19 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-11-24 20:35:17 (GMT)
commit332d60c56dfaa11fdd135088279d15cd5983b3d4 (patch)
treedd77717a4e1732da929d5ff8a0471fa3f005e201 /3rdParty/Boost/src/boost/functional/hash
parent90c44a10fec26d2a0935b2d62e82b6a5be028373 (diff)
downloadswift-332d60c56dfaa11fdd135088279d15cd5983b3d4.zip
swift-332d60c56dfaa11fdd135088279d15cd5983b3d4.tar.bz2
Upgraded Boost to 1.45.0.
Diffstat (limited to '3rdParty/Boost/src/boost/functional/hash')
-rw-r--r--3rdParty/Boost/src/boost/functional/hash/hash.hpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/3rdParty/Boost/src/boost/functional/hash/hash.hpp b/3rdParty/Boost/src/boost/functional/hash/hash.hpp
index e85ca5a..0eedf7f 100644
--- a/3rdParty/Boost/src/boost/functional/hash/hash.hpp
+++ b/3rdParty/Boost/src/boost/functional/hash/hash.hpp
@@ -16,6 +16,10 @@
#include <string>
#include <boost/limits.hpp>
+#if defined(BOOST_HASH_NO_IMPLICIT_CASTS)
+#include <boost/static_assert.hpp>
+#endif
+
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
#include <boost/type_traits/is_pointer.hpp>
#endif
@@ -29,6 +33,18 @@
namespace boost
{
+#if defined(BOOST_HASH_NO_IMPLICIT_CASTS)
+
+ // If you get a static assertion here, it's because hash_value
+ // isn't declared for your type.
+ template <typename T>
+ std::size_t hash_value(T const&) {
+ BOOST_STATIC_ASSERT((T*) 0 && false);
+ return 0;
+ }
+
+#endif
+
std::size_t hash_value(bool);
std::size_t hash_value(char);
std::size_t hash_value(unsigned char);
@@ -193,9 +209,15 @@ namespace boost
template <class T> std::size_t hash_value(T* v)
#endif
{
+#if defined(__VMS) && __INITIAL_POINTER_SIZE == 64
+ // for some reason ptrdiff_t on OpenVMS compiler with
+ // 64 bit is not 64 bit !!!
+ std::size_t x = static_cast<std::size_t>(
+ reinterpret_cast<long long int>(v));
+#else
std::size_t x = static_cast<std::size_t>(
reinterpret_cast<std::ptrdiff_t>(v));
-
+#endif
return x + (x >> 3);
}