From 44f7a47914d285e4309f5bbb04a3bb7322bfb7d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Mon, 19 Nov 2007 18:32:12 +0000 Subject: [PATCH] Fixed 64 bit std::size_t specialization error [SVN r41240] --- include/boost/intrusive/detail/utilities.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/boost/intrusive/detail/utilities.hpp b/include/boost/intrusive/detail/utilities.hpp index eebb8a6..4b4ee33 100644 --- a/include/boost/intrusive/detail/utilities.hpp +++ b/include/boost/intrusive/detail/utilities.hpp @@ -24,6 +24,7 @@ #include #include #include +#include namespace boost { namespace intrusive { @@ -520,16 +521,16 @@ struct sqrt2_pow_max; template<> struct sqrt2_pow_max<32> { - static const std::size_t value = 0xb504f334; + static const boost::uint32_t value = 0xb504f334; static const std::size_t pow = 31; }; -#ifndef BOOST_NO_INT64_T +#ifdef BOOST_HAS_LONG_LONG template<> struct sqrt2_pow_max<64> { - static const std::size_t value = 0xb504f333f9de6484; + static const boost::uint64_t value = 0xb504f333f9de6484ull; static const std::size_t pow = 63; }; @@ -539,8 +540,8 @@ struct sqrt2_pow_max<64> // Defined for X from 0 up to the number of bits in size_t minus 1. inline std::size_t sqrt2_pow_2xplus1 (std::size_t x) { - const std::size_t value = sqrt2_pow_max::value; - const std::size_t pow = sqrt2_pow_max::pow; + const std::size_t value = (std::size_t)sqrt2_pow_max::value; + const std::size_t pow = (std::size_t)sqrt2_pow_max::pow; return (value >> (pow - x)) + 1; }