From 5c5ff11ee020f14fc903fa583fc03095c888cbee Mon Sep 17 00:00:00 2001 From: Daniel James Date: Tue, 15 May 2007 19:44:46 +0000 Subject: [PATCH] Clean up the 64-bit std::size_t workaround and hopefully suppress the warning on 32-bit Visual C++. [SVN r37694] --- include/boost/functional/hash/hash.hpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/include/boost/functional/hash/hash.hpp b/include/boost/functional/hash/hash.hpp index 251f96d..f7d0f2b 100644 --- a/include/boost/functional/hash/hash.hpp +++ b/include/boost/functional/hash/hash.hpp @@ -1,5 +1,5 @@ -// Copyright Daniel James 2005-2006. Use, modification, and distribution are +// Copyright Daniel James 2005-2007. Use, modification, and distribution are // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -28,6 +28,11 @@ #include #endif +#if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable:4267) +#endif + namespace boost { #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551)) @@ -41,12 +46,13 @@ namespace boost std::size_t hash_value(long); std::size_t hash_value(unsigned long); -#if defined(BOOST_MSVC) && defined(_WIN64) +#if defined(_M_X64) && defined(_WIN64) // On 64-bit windows std::size_t is a typedef for unsigned long long, which // isn't due to be supported until Boost 1.35. So add support here. // (Technically, Boost.Hash isn't actually documented as supporting // std::size_t. But it would be pretty silly not to). - std::size_t hash_value(std::size_t); + std::size_t hash_value(long long); + std::size_t hash_value(unsigned long long); #endif #if !BOOST_WORKAROUND(__DMC__, <= 0x848) @@ -588,5 +594,9 @@ namespace boost #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION } +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif + #endif