updated boost on windows

This commit is contained in:
Bassem Girgis
2019-08-13 21:48:48 -05:00
parent 7d77d485fd
commit b40a3bee82
5162 changed files with 473027 additions and 116452 deletions

View File

@@ -53,16 +53,14 @@ namespace boost { namespace spirit { namespace karma
, Attribute const& attr_) const
{
typedef typename attribute<Context, unused_type>::type attr_type;
typedef traits::make_attribute<attr_type, Attribute> make_attribute;
// create a attribute if none is supplied
// this creates a _copy_ of the attribute because the semantic
// action will likely change parts of this
typedef traits::transform_attribute<
typename make_attribute::type, attr_type, domain> transform;
Attribute const, attr_type, domain> transform;
typename transform::type attr =
traits::pre_transform<domain, attr_type>(make_attribute::call(attr_));
attr_type attr = transform::pre(attr_);
// call the function, passing the attribute, the context and a bool
// flag that the client can set to false to fail generating.

View File

@@ -31,9 +31,7 @@ namespace boost { namespace spirit
namespace boost { namespace spirit { namespace karma
{
#ifndef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
using spirit::attr_cast;
#endif
///////////////////////////////////////////////////////////////////////////
// attr_cast_generator consumes the attribute of subject generator without

View File

@@ -59,7 +59,7 @@ namespace boost { namespace spirit { namespace karma
, typename Delimiter, typename Attribute>
bool lazy_generate_impl(Generator const& g, OutputIterator& sink
, Context& context, Delimiter const& delim
, Attribute const& attr, mpl::true_)
, Attribute const& /* attr */, mpl::true_)
{
// If DeducedAuto is false (semantic actions is present), the
// component's attribute is unused.

View File

@@ -194,11 +194,11 @@ namespace boost { namespace spirit { namespace karma
};
///////////////////////////////////////////////////////////////////////
template <BOOST_SCOPED_ENUM(boost::endian::endianness) bits>
template <BOOST_SCOPED_ENUM(boost::spirit::endian::endianness) bits>
struct what;
template <>
struct what<boost::endian::endianness::native>
struct what<boost::spirit::endian::endianness::native>
{
static info is()
{
@@ -207,7 +207,7 @@ namespace boost { namespace spirit { namespace karma
};
template <>
struct what<boost::endian::endianness::little>
struct what<boost::spirit::endian::endianness::little>
{
static info is()
{
@@ -216,7 +216,7 @@ namespace boost { namespace spirit { namespace karma
};
template <>
struct what<boost::endian::endianness::big>
struct what<boost::spirit::endian::endianness::big>
{
static info is()
{
@@ -226,7 +226,7 @@ namespace boost { namespace spirit { namespace karma
}
///////////////////////////////////////////////////////////////////////////
template <typename T, BOOST_SCOPED_ENUM(boost::endian::endianness) endian, int bits>
template <typename T, BOOST_SCOPED_ENUM(boost::spirit::endian::endianness) endian, int bits>
struct any_binary_generator
: primitive_generator<any_binary_generator<T, endian, bits> >
{
@@ -245,7 +245,7 @@ namespace boost { namespace spirit { namespace karma
// Even if the endian types are not pod's (at least not in the
// definition of C++03) it seems to be safe to assume they are.
// This allows us to treat them as a sequence of consecutive bytes.
boost::endian::endian<endian, typename T::type, bits> p;
boost::spirit::endian::endian<endian, typename T::type, bits> p;
#if defined(BOOST_MSVC)
// warning C4244: 'argument' : conversion from 'const int' to 'foo', possible loss of data
@@ -293,7 +293,7 @@ namespace boost { namespace spirit { namespace karma
};
///////////////////////////////////////////////////////////////////////////
template <typename T, BOOST_SCOPED_ENUM(boost::endian::endianness) endian, int bits>
template <typename T, BOOST_SCOPED_ENUM(boost::spirit::endian::endianness) endian, int bits>
struct literal_binary_generator
: primitive_generator<literal_binary_generator<T, endian, bits> >
{
@@ -344,7 +344,7 @@ namespace boost { namespace spirit { namespace karma
return karma::detail::what<endian>::is();
}
typedef boost::endian::endian<endian, typename T::type,
typedef boost::spirit::endian::endian<endian, typename T::type,
bits> data_type;
data_type data_;
@@ -355,7 +355,7 @@ namespace boost { namespace spirit { namespace karma
///////////////////////////////////////////////////////////////////////////
namespace detail
{
template <typename T, BOOST_SCOPED_ENUM(boost::endian::endianness) endian
template <typename T, BOOST_SCOPED_ENUM(boost::spirit::endian::endianness) endian
, int bits>
struct basic_binary
{
@@ -368,7 +368,7 @@ namespace boost { namespace spirit { namespace karma
};
template <typename Modifiers, typename T
, BOOST_SCOPED_ENUM(boost::endian::endianness) endian, int bits>
, BOOST_SCOPED_ENUM(boost::spirit::endian::endianness) endian, int bits>
struct basic_binary_literal
{
typedef literal_binary_generator<T, endian, bits> result_type;
@@ -385,13 +385,13 @@ namespace boost { namespace spirit { namespace karma
template <typename Modifiers> \
struct make_primitive<tag::name, Modifiers> \
: detail::basic_binary<detail::integer<bits>, \
boost::endian::endianness::endiantype, bits> {}; \
boost::spirit::endian::endianness::endiantype, bits> {}; \
\
template <typename Modifiers, typename A0> \
struct make_primitive<terminal_ex<tag::name, fusion::vector1<A0> > \
, Modifiers> \
: detail::basic_binary_literal<Modifiers, detail::integer<bits> \
, boost::endian::endianness::endiantype, bits> {}; \
, boost::spirit::endian::endianness::endiantype, bits> {}; \
\
/***/
@@ -414,13 +414,13 @@ namespace boost { namespace spirit { namespace karma
template <typename Modifiers> \
struct make_primitive<tag::name, Modifiers> \
: detail::basic_binary<detail::floating_point<bits>, \
boost::endian::endianness::endiantype, bits> {}; \
boost::spirit::endian::endianness::endiantype, bits> {}; \
\
template <typename Modifiers, typename A0> \
struct make_primitive<terminal_ex<tag::name, fusion::vector1<A0> > \
, Modifiers> \
: detail::basic_binary_literal<Modifiers, detail::floating_point<bits> \
, boost::endian::endianness::endiantype, bits> {}; \
, boost::spirit::endian::endianness::endiantype, bits> {}; \
\
/***/

View File

@@ -180,7 +180,7 @@ namespace boost { namespace spirit { namespace karma
bool test(Attribute const& attr, CharParam& ch_, Context&) const
{
// fail if attribute isn't matched my immediate literal
ch_ = attr;
ch_ = static_cast<char_type>(attr);
return attr == ch;
}

View File

@@ -90,7 +90,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
#endif
return call(component, sink, ctx, d, attr
, spirit::traits::not_is_variant<Attribute, karma::domain>());
, spirit::traits::not_is_variant_or_variant_in_optional<Attribute, karma::domain>());
}
template <typename OutputIterator, typename Context, typename Delimiter>

View File

@@ -44,22 +44,6 @@ namespace boost { namespace spirit { namespace karma
// Karma only, no post() and no fail() required
};
// reference types need special handling
template <typename Exposed, typename Transformed>
struct transform_attribute<Exposed&, Transformed>
: transform_attribute<Exposed, Transformed>
{};
template <typename Exposed, typename Transformed>
struct transform_attribute<Exposed const&, Transformed>
: transform_attribute<Exposed const, Transformed>
{};
template <typename Attribute>
struct transform_attribute<Attribute const&, Attribute>
: transform_attribute<Attribute const, Attribute>
{};
// unused_type needs some special handling as well
template <>
struct transform_attribute<unused_type, unused_type>
@@ -73,16 +57,6 @@ namespace boost { namespace spirit { namespace karma
: transform_attribute<unused_type, unused_type>
{};
template <typename Attribute>
struct transform_attribute<unused_type, Attribute>
: transform_attribute<unused_type, unused_type>
{};
template <typename Attribute>
struct transform_attribute<unused_type const, Attribute>
: transform_attribute<unused_type, unused_type>
{};
template <typename Attribute>
struct transform_attribute<Attribute, unused_type>
: transform_attribute<unused_type, unused_type>
@@ -95,14 +69,12 @@ namespace boost { namespace spirit { namespace karma
}}}
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit { namespace traits
namespace boost { namespace spirit { namespace traits { namespace detail
{
template <typename Exposed, typename Transformed>
struct transform_attribute<Exposed, Transformed, karma::domain>
struct transform_attribute_base<Exposed, Transformed, karma::domain>
: karma::transform_attribute<Exposed, Transformed>
{};
}}}
}}}}
#endif

View File

@@ -44,40 +44,45 @@ namespace boost { namespace spirit { namespace traits
}
// This is the default case: the plain attribute values
template <typename Attribute, typename Exposed, typename Enable/*= void*/>
struct extract_from_attribute
template <typename Attribute, typename Exposed
, bool IsOneElemSeq = traits::one_element_sequence<Attribute>::value>
struct extract_from_attribute_base
{
typedef typename traits::one_element_sequence<Attribute>::type
is_one_element_sequence;
typedef typename mpl::eval_if<
is_one_element_sequence
, detail::value_at_c<Attribute, 0>
, mpl::identity<Attribute const&>
>::type type;
typedef Attribute const& type;
template <typename Context>
static type call(Attribute const& attr, Context&, mpl::false_)
static type call(Attribute const& attr, Context&)
{
return attr;
}
};
// This handles the case where the attribute is a single element fusion
// sequence. We silently extract the only element and treat it as the
// attribute to generate output from.
template <typename Context>
static type call(Attribute const& attr, Context& ctx, mpl::true_)
{
return extract_from<Exposed>(fusion::at_c<0>(attr), ctx);
}
// This handles the case where the attribute is a single element fusion
// sequence. We silently extract the only element and treat it as the
// attribute to generate output from.
template <typename Attribute, typename Exposed>
struct extract_from_attribute_base<Attribute, Exposed, true>
{
typedef typename remove_const<
typename remove_reference<
typename fusion::result_of::at_c<Attribute, 0>::type
>::type
>::type elem_type;
typedef typename result_of::extract_from<Exposed, elem_type>::type type;
template <typename Context>
static type call(Attribute const& attr, Context& ctx)
{
return call(attr, ctx, is_one_element_sequence());
return extract_from<Exposed>(fusion::at_c<0>(attr), ctx);
}
};
template <typename Attribute, typename Exposed, typename Enable/*= void*/>
struct extract_from_attribute
: extract_from_attribute_base<Attribute, Exposed>
{};
// This handles optional attributes.
template <typename Attribute, typename Exposed>
struct extract_from_attribute<boost::optional<Attribute>, Exposed>

View File

@@ -12,6 +12,7 @@
#include <boost/spirit/home/support/unused.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <iterator> // for std::iterator_traits
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit { namespace karma { namespace detail
@@ -23,13 +24,13 @@ namespace boost { namespace spirit { namespace karma { namespace detail
class indirect_iterator
: public boost::iterator_facade<
indirect_iterator<Iterator>
, typename boost::detail::iterator_traits<Iterator>::value_type
, typename std::iterator_traits<Iterator>::value_type
, boost::forward_traversal_tag
, typename boost::detail::iterator_traits<Iterator>::reference>
, typename std::iterator_traits<Iterator>::reference>
{
typedef typename boost::detail::iterator_traits<Iterator>::value_type
typedef typename std::iterator_traits<Iterator>::value_type
base_value_type;
typedef typename boost::detail::iterator_traits<Iterator>::reference
typedef typename std::iterator_traits<Iterator>::reference
base_reference_type;
typedef boost::iterator_facade<

View File

@@ -191,7 +191,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
// wchar_t is only 16-bits on Windows. If BOOST_SPIRIT_UNICODE is
// defined, the character type is 32-bits wide so we need to make
// sure the buffer is at least that wide.
#if defined(BOOST_MSVC) && defined(BOOST_SPIRIT_UNICODE)
#if (defined(_WIN32) || defined(__CYGWIN__)) && defined(BOOST_SPIRIT_UNICODE)
typedef spirit::char_encoding::unicode::char_type buffer_char_type;
#else
typedef wchar_t buffer_char_type;
@@ -304,7 +304,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
struct no_buffering_policy
{
no_buffering_policy() {}
no_buffering_policy(no_counting_policy const&) {}
no_buffering_policy(no_buffering_policy const&) {}
template <typename T>
bool output(T const& /*value*/)

View File

@@ -26,7 +26,6 @@
#include <boost/spirit/home/support/unused.hpp>
#include <boost/fusion/include/at.hpp>
#include <boost/fusion/include/vector.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/integer_traits.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/utility/enable_if.hpp>

View File

@@ -26,7 +26,6 @@
#include <boost/spirit/home/support/handles_container.hpp>
#include <boost/fusion/include/at.hpp>
#include <boost/fusion/include/vector.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/integer_traits.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/utility/enable_if.hpp>

View File

@@ -26,7 +26,6 @@
#include <boost/spirit/home/support/unused.hpp>
#include <boost/fusion/include/at.hpp>
#include <boost/fusion/include/vector.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/detail/workaround.hpp>
///////////////////////////////////////////////////////////////////////////////

View File

@@ -26,7 +26,6 @@
#include <boost/spirit/home/support/unused.hpp>
#include <boost/fusion/include/at.hpp>
#include <boost/fusion/include/vector.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/integer_traits.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/utility/enable_if.hpp>

View File

@@ -178,7 +178,7 @@ namespace boost { namespace spirit { namespace karma
}
template <typename Auto, typename Expr>
static void define(rule& lhs, Expr const& expr, mpl::false_)
static void define(rule& /* lhs */, Expr const& /* expr */, mpl::false_)
{
// Report invalid expression error as early as possible.
// If you got an error_invalid_expression error message here,
@@ -286,15 +286,11 @@ namespace boost { namespace spirit { namespace karma
if (f)
{
// Create an attribute if none is supplied.
typedef traits::make_attribute<attr_type, Attribute>
make_attribute;
typedef traits::transform_attribute<
typename make_attribute::type, attr_type, domain>
Attribute const, attr_type, domain>
transform;
typename transform::type attr_ =
traits::pre_transform<domain, attr_type>(
make_attribute::call(attr));
typename transform::type attr_ = transform::pre(attr);
// If you are seeing a compilation error here, you are probably
// trying to use a rule or a grammar which has inherited
@@ -326,15 +322,11 @@ namespace boost { namespace spirit { namespace karma
if (f)
{
// Create an attribute if none is supplied.
typedef traits::make_attribute<attr_type, Attribute>
make_attribute;
typedef traits::transform_attribute<
typename make_attribute::type, attr_type, domain>
Attribute const, attr_type, domain>
transform;
typename transform::type attr_ =
traits::pre_transform<domain, attr_type>(
make_attribute::call(attr));
typename transform::type attr_ = transform::pre(attr);
// If you are seeing a compilation error here, you are probably
// trying to use a rule or a grammar which has inherited

View File

@@ -14,6 +14,7 @@
#include <boost/config/no_tr1/cmath.hpp>
#include <boost/limits.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/spirit/home/support/char_class.hpp>
#include <boost/spirit/home/support/unused.hpp>
@@ -68,7 +69,11 @@ namespace boost { namespace spirit { namespace traits
typedef unsignedtype type; \
static type call(signedtype n) \
{ \
return (n >= 0) ? n : (unsignedtype)(-n); \
/* implementation is well-defined for one's complement, */ \
/* two's complement, and signed magnitude architectures */ \
/* by the C++ Standard. [conv.integral] [expr.unary.op] */ \
return (n >= 0) ? static_cast<type>(n) \
: -static_cast<type>(n); \
} \
} \
/**/
@@ -84,6 +89,11 @@ namespace boost { namespace spirit { namespace traits
} \
/**/
#if defined(BOOST_MSVC)
# pragma warning(push)
// unary minus operator applied to unsigned type, result still unsigned
# pragma warning(disable: 4146)
#endif
BOOST_SPIRIT_ABSOLUTE_VALUE(signed char, unsigned char);
BOOST_SPIRIT_ABSOLUTE_VALUE(char, unsigned char);
BOOST_SPIRIT_ABSOLUTE_VALUE(short, unsigned short);
@@ -97,6 +107,9 @@ namespace boost { namespace spirit { namespace traits
BOOST_SPIRIT_ABSOLUTE_VALUE(boost::long_long_type, boost::ulong_long_type);
BOOST_SPIRIT_ABSOLUTE_VALUE_UNSIGNED(boost::ulong_long_type);
#endif
#if defined(BOOST_MSVC)
# pragma warning(pop)
#endif
#undef BOOST_SPIRIT_ABSOLUTE_VALUE
#undef BOOST_SPIRIT_ABSOLUTE_VALUE_UNSIGNED
@@ -285,7 +298,7 @@ namespace boost { namespace spirit { namespace traits
{
static bool call(T n)
{
if (!std::numeric_limits<T>::has_infinity)
if (!std::numeric_limits<T>::has_infinity)
return false;
return (n == std::numeric_limits<T>::infinity()) ? true : false;
}
@@ -771,4 +784,3 @@ namespace boost { namespace spirit { namespace karma
}}}
#endif

View File

@@ -105,7 +105,13 @@ namespace boost { namespace spirit { namespace karma
if (exp != -dim)
++exp;
dim = static_cast<U>(-exp);
n *= spirit::traits::pow10<U>(exp);
// detect and handle denormalized numbers to prevent overflow in pow10
if (exp > std::numeric_limits<U>::max_exponent10)
{
n *= spirit::traits::pow10<U>(std::numeric_limits<U>::max_exponent10);
n *= spirit::traits::pow10<U>(exp - std::numeric_limits<U>::max_exponent10);
} else
n *= spirit::traits::pow10<U>(exp);
}
}

View File

@@ -25,9 +25,13 @@ namespace boost { namespace spirit { namespace karma
typename T, typename Elem = char
, typename Traits = std::char_traits<Elem> >
class ostream_iterator
: public std::iterator<std::output_iterator_tag, void, void, void, void>
{
public:
typedef std::output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
typedef Elem char_type;
typedef Traits traits_type;
typedef std::basic_ostream<Elem, Traits> ostream_type;