diff --git a/include/boost/detail/allocator_utilities.hpp b/include/boost/detail/allocator_utilities.hpp index 6929087..5a9a79e 100644 --- a/include/boost/detail/allocator_utilities.hpp +++ b/include/boost/detail/allocator_utilities.hpp @@ -1,4 +1,4 @@ -/* Copyright 2003-2005 Joaquín M López Muñoz. +/* Copyright 2003-2007 Joaquín M López Muñoz. * Distributed under 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) @@ -30,13 +30,21 @@ namespace detail{ namespace allocator{ /* partial_std_allocator_wrapper inherits the functionality of a std - * allocator while providing a templatized ctor. + * allocator while providing a templatized ctor and other bits missing + * in some stdlib implementation or another. */ template class partial_std_allocator_wrapper:public std::allocator { public: + /* Oddly enough, STLport does not define std::allocator::value_type + * when configured to work without partial template specialization. + * No harm in supplying the definition here unconditionally. + */ + + typedef Type value_type; + partial_std_allocator_wrapper(){}; template diff --git a/include/boost/detail/interlocked.hpp b/include/boost/detail/interlocked.hpp index 76a24c3..258320c 100644 --- a/include/boost/detail/interlocked.hpp +++ b/include/boost/detail/interlocked.hpp @@ -47,6 +47,11 @@ extern "C" long __cdecl InterlockedExchangeAdd( long*, long ); # define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange # define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd +# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \ + ((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long*)(dest),(long)(exchange),(long)(compare))) +# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \ + ((void*)BOOST_INTERLOCKED_EXCHANGE((long*)(dest),(long)(exchange))) + #elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN ) extern "C" long __cdecl _InterlockedIncrement( long volatile * ); diff --git a/utf8_codecvt_facet.cpp b/utf8_codecvt_facet.cpp index 20d79de..8a8c3ca 100644 --- a/utf8_codecvt_facet.cpp +++ b/utf8_codecvt_facet.cpp @@ -139,8 +139,8 @@ std::codecvt_base::result utf8_codecvt_facet::do_out( int shift_exponent = (cont_octet_count) * 6; // Process the first character - *to++ = octet1_modifier_table[cont_octet_count] + - (unsigned char)(*from / (1 << shift_exponent)); + *to++ = static_cast(octet1_modifier_table[cont_octet_count] + + (unsigned char)(*from / (1 << shift_exponent))); // Process the continuation characters // Invariants: At the start of the loop: @@ -150,7 +150,7 @@ std::codecvt_base::result utf8_codecvt_facet::do_out( int i = 0; while (i != cont_octet_count && to != to_end) { shift_exponent -= 6; - *to++ = 0x80 + ((*from / (1 << shift_exponent)) % (1 << 6)); + *to++ = static_cast(0x80 + ((*from / (1 << shift_exponent)) % (1 << 6))); ++i; } // If we filled up the out buffer before encoding the character @@ -199,7 +199,7 @@ int utf8_codecvt_facet::do_length( last_octet_count = (get_octet_count(*from_next)); ++char_count; } - return from_next-from_end; + return static_cast(from_next-from_end); } unsigned int utf8_codecvt_facet::get_octet_count(