From ec2f62b19da6d9491281113d5d9ad264ae2e1a34 Mon Sep 17 00:00:00 2001 From: Michael Wetherell Date: Thu, 2 Nov 2006 21:48:56 +0000 Subject: [PATCH] Use the standard hash on 64-bit machines. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42964 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/hashmap.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/wx/hashmap.h b/include/wx/hashmap.h index 2b3d1e665f..35254a6fb9 100644 --- a/include/wx/hashmap.h +++ b/include/wx/hashmap.h @@ -465,11 +465,17 @@ class WXDLLIMPEXP_BASE wxIntegerHash WX_HASH_MAP_NAMESPACE::hash ushortHash; #if defined wxLongLong_t && !defined wxLongLongIsLong + // hash ought to work, but some 32-bit compilers have been + // found where the hash doesn't work with 64-bit values. + #if SIZEOF_LONG == 4 && (!defined SIZEOF_LONG_LONG || SIZEOF_LONG_LONG == 8) size_t longlongHash( wxLongLong_t x ) const { - return longHash( wx_truncate_cast(wxUint32, x) ) ^ - longHash( wx_truncate_cast(wxUint32, x >> (sizeof(wxUint32) * 8)) ); + return longHash( wx_truncate_cast(long, x) ) ^ + longHash( wx_truncate_cast(long, x >> (sizeof(long) * 8)) ); } + #else + WX_HASH_MAP_NAMESPACE::hash longlongHash; + #endif #endif public: -- 2.45.2