From 0ae94ec276d8d9e77c9af98ba6a5fd3e9bd7cc9e Mon Sep 17 00:00:00 2001 From: Daniel James Date: Tue, 27 Jul 2010 19:18:53 +0000 Subject: [PATCH] Fix hashing pointers on 64-bit OpenVMS. Patch by Artyom. Refs #4477 [SVN r64397] --- include/boost/functional/hash/hash.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/boost/functional/hash/hash.hpp b/include/boost/functional/hash/hash.hpp index 108d3ed..0eedf7f 100644 --- a/include/boost/functional/hash/hash.hpp +++ b/include/boost/functional/hash/hash.hpp @@ -209,9 +209,15 @@ namespace boost template 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( + reinterpret_cast(v)); +#else std::size_t x = static_cast( reinterpret_cast(v)); - +#endif return x + (x >> 3); }