Fix hashing pointers on 64-bit OpenVMS.

Patch by Artyom. Refs #4477

[SVN r64397]
This commit is contained in:
Daniel James
2010-07-27 19:18:53 +00:00
parent ef1bfd0174
commit 0ae94ec276

View File

@@ -209,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);
}