Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64397 - trunk/boost/functional/hash
From: daniel_james_at_[hidden]
Date: 2010-07-27 15:18:53


Author: danieljames
Date: 2010-07-27 15:18:53 EDT (Tue, 27 Jul 2010)
New Revision: 64397
URL: http://svn.boost.org/trac/boost/changeset/64397

Log:
Fix hashing pointers on 64-bit OpenVMS.

Patch by Artyom. Refs #4477
Text files modified:
   trunk/boost/functional/hash/hash.hpp | 8 +++++++-
   1 files changed, 7 insertions(+), 1 deletions(-)

Modified: trunk/boost/functional/hash/hash.hpp
==============================================================================
--- trunk/boost/functional/hash/hash.hpp (original)
+++ trunk/boost/functional/hash/hash.hpp 2010-07-27 15:18:53 EDT (Tue, 27 Jul 2010)
@@ -209,9 +209,15 @@
     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);
     }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk