Quickbook: Merge to quickbook-dev

[SVN r76630]
This commit is contained in:
Daniel James committed 2012-01-21 21:43:17 +00:00
1 parent 5638b5dbec
commit 105c713326
5 files changed
+173 -17

No files matched your search

+63 -16
View File
@@ -18,8 +18,34 @@
// with additional fixes and suggestions from Gennaro Prota,
// Beman Dawes, Dave Abrahams, Daryle Walker, Peter Dimov,
// Alexander Nasonov, Antony Polukhin, Justin Viiret, Michael Hofmann,
// Cheng Yang, Matthew Bradbury and other Boosters
// when: November 2000, March 2003, June 2005, June 2006, March 2011
// Cheng Yang, Matthew Bradbury, David W. Birdsall and other Boosters
// when: November 2000, March 2003, June 2005, June 2006, March 2011 - 2012
#include <boost/config.hpp>
#if defined(BOOST_NO_STRINGSTREAM) || defined(BOOST_NO_STD_WSTRING)
#define BOOST_LCAST_NO_WCHAR_T
#endif
#if (defined(__MINGW32__) || defined(__MINGW64__)) && (__GNUC__ == 4) \
&& ((__GNUC_MINOR__ == 4) || (__GNUC_MINOR__ == 5)) && defined(__STRICT_ANSI__) \
&& !defined(BOOST_LCAST_NO_WCHAR_T)
// workaround for a mingw bug
// http://sourceforge.net/tracker/index.php?func=detail&aid=2373234&group_id=2435&atid=102435
#include <_mingw.h>
#if (__GNUC_MINOR__ == 4)
extern "C" {
_CRTIMP int __cdecl swprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ , ...);
_CRTIMP int __cdecl vswprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ , ...);
}
#endif
#if (__GNUC_MINOR__ == 5)
extern "C" {
_CRTIMP int __cdecl swprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ , ...);
_CRTIMP int __cdecl vswprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ , va_list);
}
#endif
#endif
#include <climits>
#include <cstddef>
@@ -30,7 +56,6 @@
#include <typeinfo>
#include <exception>
#include <cmath>
#include <boost/config.hpp>
#include <boost/limits.hpp>
#include <boost/mpl/if.hpp>
#include <boost/throw_exception.hpp>
@@ -67,10 +92,6 @@
#include <sstream>
#endif
#if defined(BOOST_NO_STRINGSTREAM) || defined(BOOST_NO_STD_WSTRING)
#define BOOST_LCAST_NO_WCHAR_T
#endif
#ifdef BOOST_NO_TYPEID
#define BOOST_LCAST_THROW_BAD_CAST(S, T) throw_exception(bad_lexical_cast())
#else
@@ -591,6 +612,7 @@ namespace boost
value = *end - czero;
--end;
T multiplier = 1;
bool multiplier_overflowed = false;
#ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE
std::locale loc;
@@ -613,12 +635,17 @@ namespace boost
for(;end>=begin; --end)
{
if (remained) {
T const new_sub_value = multiplier * 10 * (*end - czero);
T const multiplier_10 = multiplier * 10;
if (multiplier_10 / 10 != multiplier) multiplier_overflowed = true;
T const dig_value = *end - czero;
T const new_sub_value = multiplier_10 * dig_value;
if (*end < czero || *end >= czero + 10
/* detecting overflow */
|| new_sub_value/10 != multiplier * (*end - czero)
|| (dig_value && new_sub_value / dig_value != multiplier_10)
|| static_cast<T>((std::numeric_limits<T>::max)()-new_sub_value) < value
|| (multiplier_overflowed && dig_value)
)
return false;
@@ -656,12 +683,17 @@ namespace boost
{
while ( begin <= end )
{
T const new_sub_value = multiplier * 10 * (*end - czero);
T const multiplier_10 = multiplier * 10;
if (multiplier_10 / 10 != multiplier) multiplier_overflowed = true;
T const dig_value = *end - czero;
T const new_sub_value = multiplier_10 * dig_value;
if (*end < czero || *end >= czero + 10
/* detecting overflow */
|| new_sub_value/10 != multiplier * (*end - czero)
|| (dig_value && new_sub_value / dig_value != multiplier_10)
|| static_cast<T>((std::numeric_limits<T>::max)()-new_sub_value) < value
|| (multiplier_overflowed && dig_value)
)
return false;
@@ -1822,6 +1854,24 @@ namespace boost
deduce_char_traits<char_type,Target,Source>::type traits;
typedef BOOST_DEDUCED_TYPENAME remove_pointer<src >::type removed_ptr_t;
// is_char_types_match variable value can be computed via
// sizeof(char_type) == sizeof(removed_ptr_t). But when
// removed_ptr_t is an incomplete type or void*, compilers
// produce warnings or errors.
const bool is_char_types_match =
(::boost::type_traits::ice_or<
::boost::type_traits::ice_and<
::boost::type_traits::ice_eq<sizeof(char_type), sizeof(char) >::value,
::boost::type_traits::ice_or<
::boost::is_same<char, removed_ptr_t>::value,
::boost::is_same<unsigned char, removed_ptr_t>::value,
::boost::is_same<signed char, removed_ptr_t>::value
>::value
>::value,
is_same<char_type, removed_ptr_t>::value
>::value);
const bool requires_stringbuf =
!(
::boost::type_traits::ice_or<
@@ -1830,10 +1880,7 @@ namespace boost
::boost::type_traits::ice_and<
is_pointer<src >::value,
is_char_or_wchar<removed_ptr_t >::value,
::boost::type_traits::ice_eq<
sizeof(char_type),
sizeof(removed_ptr_t)
>::value
is_char_types_match
>::value
>::value
);
@@ -2111,7 +2158,7 @@ namespace boost
// Copyright Kevlin Henney, 2000-2005.
// Copyright Alexander Nasonov, 2006-2010.
// Copyright Antony Polukhin, 2011.
// Copyright Antony Polukhin, 2011-2012.
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at