Merge branch 'develop'

This commit is contained in:
Robert Ramey
2014-03-02 10:44:24 -08:00
27 changed files with 644 additions and 826 deletions

View File

@@ -1,4 +1,4 @@
/* Copyright 2003-2009 Joaquin M Lopez Munoz.
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
* 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)

View File

@@ -24,11 +24,7 @@
#include <exception> // for exception, bad_exception
#include <stdexcept> // for std exception hierarchy
#include <boost/cstdlib.hpp> // for exit codes
# if __GNUC__ != 2 || __GNUC_MINOR__ > 96
# include <ostream> // for ostream
# else
# include <iostream> // workaround GNU missing ostream header
# endif
#include <ostream> // for ostream
# if defined(__BORLANDC__) && (__BORLANDC__ <= 0x0551)
# define BOOST_BUILT_IN_EXCEPTIONS_MISSING_WHAT

View File

@@ -8,7 +8,7 @@
#if !defined(BOOST_DETAIL_CONTAINER_FWD_HPP)
#define BOOST_DETAIL_CONTAINER_FWD_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1020) && \
#if defined(_MSC_VER) && \
!defined(BOOST_DETAIL_TEST_CONFIG_ONLY)
# pragma once
#endif
@@ -119,12 +119,7 @@ namespace std
template <class T> class allocator;
template <class charT, class traits, class Allocator> class basic_string;
#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
template <class charT> struct string_char_traits;
#else
template <class charT> struct char_traits;
#endif
#if defined(BOOST_CONTAINER_FWD_COMPLEX_STRUCT)
template <class T> struct complex;

View File

@@ -57,9 +57,7 @@ namespace boost
identifier() {}
explicit identifier( value_type v ) : m_value(v) {}
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 // 1300 == VC++ 7.0 bug workaround
private:
#endif
T m_value;
};

282
include/boost/detail/indirect_traits.hpp Executable file → Normal file
View File

@@ -26,15 +26,11 @@
# include <boost/mpl/not.hpp>
# include <boost/mpl/aux_/lambda_support.hpp>
# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
# include <boost/detail/is_function_ref_tester.hpp>
# endif
namespace boost { namespace detail {
namespace indirect_traits {
# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template <class T>
struct is_reference_to_const : mpl::false_
{
@@ -199,284 +195,6 @@ struct is_pointer_to_class
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_pointer_to_class,(T))
};
# else
using namespace boost::detail::is_function_ref_tester_;
typedef char (&inner_yes_type)[3];
typedef char (&inner_no_type)[2];
typedef char (&outer_no_type)[1];
template <typename V>
struct is_const_help
{
typedef typename mpl::if_<
is_const<V>
, inner_yes_type
, inner_no_type
>::type type;
};
template <typename V>
struct is_volatile_help
{
typedef typename mpl::if_<
is_volatile<V>
, inner_yes_type
, inner_no_type
>::type type;
};
template <typename V>
struct is_pointer_help
{
typedef typename mpl::if_<
is_pointer<V>
, inner_yes_type
, inner_no_type
>::type type;
};
template <typename V>
struct is_class_help
{
typedef typename mpl::if_<
is_class<V>
, inner_yes_type
, inner_no_type
>::type type;
};
template <class T>
struct is_reference_to_function_aux
{
static T t;
BOOST_STATIC_CONSTANT(
bool, value = sizeof(detail::is_function_ref_tester(t,0)) == sizeof(::boost::type_traits::yes_type));
typedef mpl::bool_<value> type;
};
template <class T>
struct is_reference_to_function
: mpl::if_<is_reference<T>, is_reference_to_function_aux<T>, mpl::bool_<false> >::type
{
};
template <class T>
struct is_pointer_to_function_aux
{
static T t;
BOOST_STATIC_CONSTANT(
bool, value
= sizeof(::boost::type_traits::is_function_ptr_tester(t)) == sizeof(::boost::type_traits::yes_type));
typedef mpl::bool_<value> type;
};
template <class T>
struct is_pointer_to_function
: mpl::if_<is_pointer<T>, is_pointer_to_function_aux<T>, mpl::bool_<false> >::type
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_pointer_to_function,(T))
};
struct false_helper1
{
template <class T>
struct apply : mpl::false_
{
};
};
template <typename V>
typename is_const_help<V>::type reference_to_const_helper(V&);
outer_no_type
reference_to_const_helper(...);
struct true_helper1
{
template <class T>
struct apply
{
static T t;
BOOST_STATIC_CONSTANT(
bool, value
= sizeof(reference_to_const_helper(t)) == sizeof(inner_yes_type));
typedef mpl::bool_<value> type;
};
};
template <bool ref = true>
struct is_reference_to_const_helper1 : true_helper1
{
};
template <>
struct is_reference_to_const_helper1<false> : false_helper1
{
};
template <class T>
struct is_reference_to_const
: is_reference_to_const_helper1<is_reference<T>::value>::template apply<T>
{
};
template <bool ref = true>
struct is_reference_to_non_const_helper1
{
template <class T>
struct apply
{
static T t;
BOOST_STATIC_CONSTANT(
bool, value
= sizeof(reference_to_const_helper(t)) == sizeof(inner_no_type));
typedef mpl::bool_<value> type;
};
};
template <>
struct is_reference_to_non_const_helper1<false> : false_helper1
{
};
template <class T>
struct is_reference_to_non_const
: is_reference_to_non_const_helper1<is_reference<T>::value>::template apply<T>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_non_const,(T))
};
template <typename V>
typename is_volatile_help<V>::type reference_to_volatile_helper(V&);
outer_no_type
reference_to_volatile_helper(...);
template <bool ref = true>
struct is_reference_to_volatile_helper1
{
template <class T>
struct apply
{
static T t;
BOOST_STATIC_CONSTANT(
bool, value
= sizeof(reference_to_volatile_helper(t)) == sizeof(inner_yes_type));
typedef mpl::bool_<value> type;
};
};
template <>
struct is_reference_to_volatile_helper1<false> : false_helper1
{
};
template <class T>
struct is_reference_to_volatile
: is_reference_to_volatile_helper1<is_reference<T>::value>::template apply<T>
{
};
template <typename V>
typename is_pointer_help<V>::type reference_to_pointer_helper(V&);
outer_no_type reference_to_pointer_helper(...);
template <class T>
struct reference_to_pointer_impl
{
static T t;
BOOST_STATIC_CONSTANT(
bool, value
= (sizeof((reference_to_pointer_helper)(t)) == sizeof(inner_yes_type))
);
typedef mpl::bool_<value> type;
};
template <class T>
struct is_reference_to_pointer
: mpl::eval_if<is_reference<T>, reference_to_pointer_impl<T>, mpl::false_>::type
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_pointer,(T))
};
template <class T>
struct is_reference_to_function_pointer
: mpl::eval_if<is_reference<T>, is_pointer_to_function_aux<T>, mpl::false_>::type
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_function_pointer,(T))
};
template <class T>
struct is_member_function_pointer_help
: mpl::if_<is_member_function_pointer<T>, inner_yes_type, inner_no_type>
{};
template <typename V>
typename is_member_function_pointer_help<V>::type member_function_pointer_helper(V&);
outer_no_type member_function_pointer_helper(...);
template <class T>
struct is_pointer_to_member_function_aux
{
static T t;
BOOST_STATIC_CONSTANT(
bool, value
= sizeof((member_function_pointer_helper)(t)) == sizeof(inner_yes_type));
typedef mpl::bool_<value> type;
};
template <class T>
struct is_reference_to_member_function_pointer
: mpl::if_<
is_reference<T>
, is_pointer_to_member_function_aux<T>
, mpl::bool_<false>
>::type
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_member_function_pointer,(T))
};
template <typename V>
typename is_class_help<V>::type reference_to_class_helper(V const volatile&);
outer_no_type reference_to_class_helper(...);
template <class T>
struct is_reference_to_class
{
static T t;
BOOST_STATIC_CONSTANT(
bool, value
= (is_reference<T>::value
& (sizeof(reference_to_class_helper(t)) == sizeof(inner_yes_type)))
);
typedef mpl::bool_<value> type;
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_class,(T))
};
template <typename V>
typename is_class_help<V>::type pointer_to_class_helper(V const volatile*);
outer_no_type pointer_to_class_helper(...);
template <class T>
struct is_pointer_to_class
{
static T t;
BOOST_STATIC_CONSTANT(
bool, value
= (is_pointer<T>::value
&& sizeof(pointer_to_class_helper(t)) == sizeof(inner_yes_type))
);
typedef mpl::bool_<value> type;
};
# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
}

View File

@@ -1,136 +0,0 @@
// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes,
// Aleksey Gurtovoy, Howard Hinnant & John Maddock 2000.
// 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)
#if !defined(BOOST_PP_IS_ITERATING)
///// header body
#ifndef BOOST_DETAIL_IS_FUNCTION_REF_TESTER_HPP_INCLUDED
#define BOOST_DETAIL_IS_FUNCTION_REF_TESTER_HPP_INCLUDED
#include "boost/type_traits/detail/yes_no_type.hpp"
#include "boost/type_traits/config.hpp"
#if defined(BOOST_TT_PREPROCESSING_MODE)
# include "boost/preprocessor/iterate.hpp"
# include "boost/preprocessor/enum_params.hpp"
# include "boost/preprocessor/comma_if.hpp"
#endif
namespace boost {
namespace detail {
namespace is_function_ref_tester_ {
template <class T>
boost::type_traits::no_type BOOST_TT_DECL is_function_ref_tester(T& ...);
#if !defined(BOOST_TT_PREPROCESSING_MODE)
// preprocessor-generated part, don't edit by hand!
template <class R>
boost::type_traits::yes_type is_function_ref_tester(R (&)(), int);
template <class R,class T0 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0), int);
template <class R,class T0,class T1 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1), int);
template <class R,class T0,class T1,class T2 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2), int);
template <class R,class T0,class T1,class T2,class T3 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3), int);
template <class R,class T0,class T1,class T2,class T3,class T4 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4), int);
template <class R,class T0,class T1,class T2,class T3,class T4,class T5 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5), int);
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6), int);
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7), int);
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8), int);
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9), int);
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10), int);
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11), int);
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12), int);
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13), int);
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14), int);
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15), int);
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16), int);
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17), int);
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18), int);
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19), int);
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20), int);
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20,class T21 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21), int);
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20,class T21,class T22 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22), int);
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20,class T21,class T22,class T23 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23), int);
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20,class T21,class T22,class T23,class T24 >
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24), int);
#else
#define BOOST_PP_ITERATION_PARAMS_1 \
(3, (0, 25, "boost/detail/is_function_ref_tester.hpp"))
#include BOOST_PP_ITERATE()
#endif // BOOST_TT_PREPROCESSING_MODE
} // namespace detail
} // namespace python
} // namespace boost
#endif // BOOST_DETAIL_IS_FUNCTION_REF_TESTER_HPP_INCLUDED
///// iteration
#else
#define i BOOST_PP_FRAME_ITERATION(1)
template <class R BOOST_PP_COMMA_IF(i) BOOST_PP_ENUM_PARAMS(i,class T) >
boost::type_traits::yes_type is_function_ref_tester(R (&)(BOOST_PP_ENUM_PARAMS(i,T)), int);
#undef i
#endif // BOOST_PP_IS_ITERATING

View File

@@ -55,8 +55,7 @@ namespace is_incrementable_
# endif
# if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202)) \
|| BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
# if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202))
# define BOOST_comma(a,b) (a)
# else
// In case an operator++ is found that returns void, we'll use ++x,0

34
include/boost/detail/is_xxx.hpp Executable file → Normal file
View File

@@ -8,39 +8,6 @@
# include <boost/mpl/bool.hpp>
# include <boost/preprocessor/enum_params.hpp>
# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
# include <boost/type_traits/is_reference.hpp>
# include <boost/type_traits/add_reference.hpp>
# define BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs) \
template <class X_> \
struct is_##name \
{ \
typedef char yes; \
typedef char (&no)[2]; \
\
static typename add_reference<X_>::type dummy; \
\
struct helpers \
{ \
template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class U) > \
static yes test( \
qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, U) >&, int \
); \
\
template <class U> \
static no test(U&, ...); \
}; \
\
BOOST_STATIC_CONSTANT( \
bool, value \
= !is_reference<X_>::value \
& (sizeof(helpers::test(dummy, 0)) == sizeof(yes))); \
\
typedef mpl::bool_<value> type; \
};
# else
# define BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs) \
template <class T> \
@@ -56,6 +23,5 @@ struct is_##name< \
{ \
};
# endif
#endif // BOOST_DETAIL_IS_XXX_DWA20051011_HPP

View File

@@ -71,7 +71,6 @@
# endif // STLPort <= 4.1b4 && no partial specialization
# if !defined(BOOST_NO_STD_ITERATOR_TRAITS) \
&& !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
&& !defined(BOOST_MSVC_STD_ITERATOR)
namespace boost { namespace detail {
@@ -87,8 +86,7 @@ using std::distance;
# else
# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
&& !defined(BOOST_MSVC_STD_ITERATOR)
# if !defined(BOOST_MSVC_STD_ITERATOR)
// This is the case where everything conforms except BOOST_NO_STD_ITERATOR_TRAITS
@@ -135,10 +133,6 @@ struct iterator_traits<T const*>
# include <boost/type_traits/detail/yes_no_type.hpp>
# include <boost/type_traits/is_pointer.hpp>
# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
# include <boost/type_traits/is_same.hpp>
# include <boost/type_traits/remove_pointer.hpp>
# endif
# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
# include <boost/type_traits/is_base_and_derived.hpp>
# endif
@@ -262,7 +256,6 @@ struct stlport_40_debug_iterator_traits
template <class T> struct pointer_iterator_traits;
# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template <class T>
struct pointer_iterator_traits<T*>
{
@@ -272,50 +265,6 @@ struct pointer_iterator_traits<T*>
typedef std::random_access_iterator_tag iterator_category;
typedef std::ptrdiff_t difference_type;
};
# else
// In case of no template partial specialization, and if T is a
// pointer, iterator_traits<T>::value_type can still be computed. For
// some basic types, remove_pointer is manually defined in
// type_traits/broken_compiler_spec.hpp. For others, do it yourself.
template<class P> class please_invoke_BOOST_TT_BROKEN_COMPILER_SPEC_on_cv_unqualified_pointee;
template<class P>
struct pointer_value_type
: mpl::if_<
is_same<P, typename remove_pointer<P>::type>
, please_invoke_BOOST_TT_BROKEN_COMPILER_SPEC_on_cv_unqualified_pointee<P>
, typename remove_const<
typename remove_pointer<P>::type
>::type
>
{
};
template<class P>
struct pointer_reference
: mpl::if_<
is_same<P, typename remove_pointer<P>::type>
, please_invoke_BOOST_TT_BROKEN_COMPILER_SPEC_on_cv_unqualified_pointee<P>
, typename remove_pointer<P>::type&
>
{
};
template <class T>
struct pointer_iterator_traits
{
typedef T pointer;
typedef std::random_access_iterator_tag iterator_category;
typedef std::ptrdiff_t difference_type;
typedef typename pointer_value_type<T>::type value_type;
typedef typename pointer_reference<T>::type reference;
};
# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
// We'll sort iterator types into one of these classifications, from which we
// can determine the difference_type, pointer, reference, and value_type

View File

@@ -3,7 +3,7 @@
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#if defined(_MSC_VER)
# pragma once
#endif

View File

@@ -1,135 +0,0 @@
#ifndef BOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED
#define BOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
// boost/detail/lightweight_thread.hpp
//
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2008 Peter Dimov
//
// 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
#include <boost/config.hpp>
#include <memory>
#include <cerrno>
// pthread_create, pthread_join
#if defined( BOOST_HAS_PTHREADS )
#include <pthread.h>
#else
#include <windows.h>
#include <process.h>
typedef HANDLE pthread_t;
int pthread_create( pthread_t * thread, void const *, unsigned (__stdcall * start_routine) (void*), void* arg )
{
HANDLE h = (HANDLE)_beginthreadex( 0, 0, start_routine, arg, 0, 0 );
if( h != 0 )
{
*thread = h;
return 0;
}
else
{
return EAGAIN;
}
}
int pthread_join( pthread_t thread, void ** /*value_ptr*/ )
{
::WaitForSingleObject( thread, INFINITE );
::CloseHandle( thread );
return 0;
}
#endif
// template<class F> int lw_thread_create( pthread_t & pt, F f );
namespace boost
{
namespace detail
{
class lw_abstract_thread
{
public:
virtual ~lw_abstract_thread() {}
virtual void run() = 0;
};
#if defined( BOOST_HAS_PTHREADS )
extern "C" void * lw_thread_routine( void * pv )
{
std::auto_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) );
pt->run();
return 0;
}
#else
unsigned __stdcall lw_thread_routine( void * pv )
{
std::auto_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) );
pt->run();
return 0;
}
#endif
template<class F> class lw_thread_impl: public lw_abstract_thread
{
public:
explicit lw_thread_impl( F f ): f_( f )
{
}
void run()
{
f_();
}
private:
F f_;
};
template<class F> int lw_thread_create( pthread_t & pt, F f )
{
std::auto_ptr<lw_abstract_thread> p( new lw_thread_impl<F>( f ) );
int r = pthread_create( &pt, 0, lw_thread_routine, p.get() );
if( r == 0 )
{
p.release();
}
return r;
}
} // namespace detail
} // namespace boost
#endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED

View File

@@ -1,7 +1,7 @@
#ifndef BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP_
#define BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP_
#if (defined _MSC_VER) && (_MSC_VER >= 1200)
#if defined(_MSC_VER)
# pragma once
#endif

View File

@@ -74,7 +74,7 @@ namespace boost { namespace detail {
template <class Number>
struct is_signed
{
#if defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || defined(BOOST_MSVC) && BOOST_MSVC <= 1300
#if defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS)
BOOST_STATIC_CONSTANT(bool, value = (Number(-1) < Number(0)));
#else
BOOST_STATIC_CONSTANT(bool, value = std::numeric_limits<Number>::is_signed);
@@ -128,15 +128,6 @@ namespace boost { namespace detail {
private:
typedef Integer integer_type;
typedef std::numeric_limits<integer_type> x;
# if defined(BOOST_MSVC) && BOOST_MSVC <= 1300
// for some reason, MSVC asserts when it shouldn't unless we make these
// local definitions
BOOST_STATIC_CONSTANT(bool, is_integer = x::is_integer);
BOOST_STATIC_CONSTANT(bool, is_specialized = x::is_specialized);
BOOST_STATIC_ASSERT(is_integer);
BOOST_STATIC_ASSERT(is_specialized);
# endif
public:
typedef typename
if_true<(int(x::is_signed)

View File

@@ -1,23 +0,0 @@
#ifndef BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED
#define BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
//
// detail/quick_allocator.hpp
//
// Copyright (c) 2003 David Abrahams
// Copyright (c) 2003 Peter Dimov
//
// 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
//
#include <boost/smart_ptr/detail/quick_allocator.hpp>
#endif // #ifndef BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED

View File

@@ -15,13 +15,8 @@
#include "boost/config.hpp"
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
# include "boost/mpl/bool.hpp"
# include "boost/type_traits/has_nothrow_copy.hpp"
#else
# include "boost/mpl/if.hpp"
# include "boost/type_traits/is_reference.hpp"
#endif
#include "boost/mpl/void.hpp"
@@ -78,7 +73,6 @@ public: // queries
template <typename T = mpl::void_> struct make_reference_content;
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
template <typename T>
struct make_reference_content
@@ -92,19 +86,6 @@ struct make_reference_content< T& >
typedef reference_content<T&> type;
};
#else // defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
template <typename T>
struct make_reference_content
: mpl::if_<
is_reference<T>
, reference_content<T>
, T
>
{
};
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION workaround
template <>
struct make_reference_content< mpl::void_ >
@@ -124,7 +105,6 @@ struct make_reference_content< mpl::void_ >
// reference_content<T&> type traits specializations
//
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
template <typename T>
struct has_nothrow_copy<
@@ -134,7 +114,6 @@ struct has_nothrow_copy<
{
};
#endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
} // namespace boost

View File

@@ -122,9 +122,13 @@ protected:
) const;
virtual std::codecvt_base::result do_out(
std::mbstate_t & state, const wchar_t * from,
const wchar_t * from_end, const wchar_t* & from_next,
char * to, char * to_end, char * & to_next
std::mbstate_t & state,
const wchar_t * from,
const wchar_t * from_end,
const wchar_t* & from_next,
char * to,
char * to_end,
char * & to_next
) const;
bool invalid_continuing_octet(unsigned char octet_1) const {
@@ -137,17 +141,19 @@ protected:
}
// continuing octets = octets except for the leading octet
static unsigned int get_cont_octet_count(unsigned char lead_octet) {
static unsigned int get_cont_octet_count(unsigned char lead_octet) {
return get_octet_count(lead_octet) - 1;
}
static unsigned int get_octet_count(unsigned char lead_octet);
static unsigned int get_octet_count(unsigned char lead_octet);
// How many "continuing octets" will be needed for this word
// == total octets - 1.
int get_cont_octet_out_count(wchar_t word) const ;
virtual bool do_always_noconv() const throw() { return false; }
virtual bool do_always_noconv() const BOOST_NOEXCEPT_OR_NOTHROW {
return false;
}
// UTF-8 isn't really stateful since we rewind on partial conversions
virtual std::codecvt_base::result do_unshift(
@@ -155,13 +161,12 @@ protected:
char * from,
char * /*to*/,
char * & next
) const
{
) const {
next = from;
return ok;
}
virtual int do_encoding() const throw() {
virtual int do_encoding() const BOOST_NOEXCEPT_OR_NOTHROW {
const int variable_byte_external_encoding=0;
return variable_byte_external_encoding;
}
@@ -173,14 +178,10 @@ protected:
const char * from,
const char * from_end,
std::size_t max_limit
#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
) const throw();
#else
) const;
#endif
) const;
// Largest possible value do_length(state,from,from_end,1) could return.
virtual int do_max_length() const throw () {
virtual int do_max_length() const BOOST_NOEXCEPT_OR_NOTHROW {
return 6; // largest UTF-8 encoding of a UCS-4 character
}
};

View File

@@ -9,9 +9,9 @@
#ifndef BOOST_DETAIL_WINAPI_BASIC_TYPES_HPP
#define BOOST_DETAIL_WINAPI_BASIC_TYPES_HPP
#include <boost/config.hpp>
#include <cstdarg>
#include <boost/cstdint.hpp>
#include <boost/detail/winapi/config.hpp>
#if defined( BOOST_USE_WINDOWS_H )
# include <windows.h>
@@ -31,6 +31,9 @@
# define WINAPI __stdcall
# endif
# endif
# ifndef NTAPI
# define NTAPI __stdcall
# endif
#else
# error "Win32 functions not available"
#endif
@@ -44,11 +47,20 @@ namespace detail {
namespace winapi {
#if defined( BOOST_USE_WINDOWS_H )
typedef ::BOOL BOOL_;
typedef ::BOOLEAN BOOLEAN_;
typedef ::PBOOLEAN PBOOLEAN_;
typedef ::BYTE BYTE_;
typedef ::WORD WORD_;
typedef ::DWORD DWORD_;
typedef ::HANDLE HANDLE_;
typedef ::HMODULE HMODULE_;
typedef ::LONG LONG_;
typedef ::ULONG ULONG_;
typedef ::LONGLONG LONGLONG_;
typedef ::ULONGLONG ULONGLONG_;
typedef ::INT_PTR INT_PTR_;
typedef ::UINT_PTR UINT_PTR_;
typedef ::LONG_PTR LONG_PTR_;
typedef ::ULONG_PTR ULONG_PTR_;
typedef ::LARGE_INTEGER LARGE_INTEGER_;
typedef ::PLARGE_INTEGER PLARGE_INTEGER_;
@@ -63,32 +75,37 @@ namespace winapi {
#else
extern "C" {
typedef int BOOL_;
typedef unsigned char BYTE_;
typedef BYTE_ BOOLEAN_;
typedef BOOLEAN_* PBOOLEAN_;
typedef unsigned short WORD_;
typedef unsigned long DWORD_;
typedef void* HANDLE_;
typedef void* HMODULE_;
typedef long LONG_;
typedef unsigned long ULONG_;
// @FIXME Which condition must be tested
//~ #if !defined(_M_IX86)
//~ #if defined(BOOST_NO_INT64_T)
//~ typedef double LONGLONG_;
//~ #else
//~ typedef __int64 LONGLONG_;
//~ #endif
//~ #else
//~ typedef double LONGLONG_;
//~ #endif
typedef boost::int64_t LONGLONG_;
typedef boost::uint64_t ULONGLONG_;
// @FIXME Which condition must be tested
# ifdef _WIN64
#if defined(__CYGWIN__)
typedef long INT_PTR_;
typedef unsigned long UINT_PTR_;
typedef long LONG_PTR_;
typedef unsigned long ULONG_PTR_;
#else
typedef __int64 INT_PTR_;
typedef unsigned __int64 UINT_PTR_;
typedef __int64 LONG_PTR_;
typedef unsigned __int64 ULONG_PTR_;
#endif
# else
typedef int INT_PTR_;
typedef unsigned int UINT_PTR_;
typedef long LONG_PTR_;
typedef unsigned long ULONG_PTR_;
# endif
@@ -113,4 +130,5 @@ extern "C" {
}
}
}
#endif // BOOST_DETAIL_WINAPI_TIME_HPP
#endif // BOOST_DETAIL_WINAPI_BASIC_TYPES_HPP

View File

@@ -0,0 +1,53 @@
// config.hpp --------------------------------------------------------------//
// Copyright 2013 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_CONFIG_HPP_INCLUDED_
#define BOOST_DETAIL_WINAPI_CONFIG_HPP_INCLUDED_
#include <boost/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
// These constants reflect _WIN32_WINNT_* macros from sdkddkver.h
// See also: http://msdn.microsoft.com/en-us/library/windows/desktop/aa383745%28v=vs.85%29.aspx#setting_winver_or__win32_winnt
#define BOOST_WINAPI_VERSION_NT4 0x0400
#define BOOST_WINAPI_VERSION_WIN2K 0x0500
#define BOOST_WINAPI_VERSION_WINXP 0x0501
#define BOOST_WINAPI_VERSION_WS03 0x0502
#define BOOST_WINAPI_VERSION_WIN6 0x0600
#define BOOST_WINAPI_VERSION_VISTA 0x0600
#define BOOST_WINAPI_VERSION_WS08 0x0600
#define BOOST_WINAPI_VERSION_LONGHORN 0x0600
#define BOOST_WINAPI_VERSION_WIN7 0x0601
#define BOOST_WINAPI_VERSION_WIN8 0x0602
#define BOOST_WINAPI_VERSION_WINBLUE 0x0603
#if !defined(BOOST_USE_WINAPI_VERSION)
#if defined(_WIN32_WINNT)
#define BOOST_USE_WINAPI_VERSION _WIN32_WINNT
#elif defined(WINVER)
#define BOOST_USE_WINAPI_VERSION WINVER
#else
// By default use Windows XP API
#define BOOST_USE_WINAPI_VERSION BOOST_WINAPI_VERSION_WINXP
#endif
#endif
#if defined(BOOST_USE_WINDOWS_H)
// We have to define the version macros so that windows.h provides the necessary symbols
#if !defined(_WIN32_WINNT)
#define _WIN32_WINNT BOOST_USE_WINAPI_VERSION
#endif
#if !defined(WINVER)
#define WINVER BOOST_USE_WINAPI_VERSION
#endif
#endif
#endif // BOOST_DETAIL_WINAPI_CONFIG_HPP_INCLUDED_

View File

@@ -23,33 +23,64 @@ namespace detail
namespace winapi
{
#if defined( BOOST_USE_WINDOWS_H )
using ::LoadLibrary;
typedef ::FARPROC FARPROC_;
typedef ::NEARPROC NEARPROC_;
typedef ::PROC PROC_;
# ifdef BOOST_NO_ANSI_APIS
using ::LoadLibraryW;
using ::GetModuleHandleW;
# else
using ::LoadLibraryA;
using ::GetModuleHandleA;
# endif
using ::FreeLibrary;
using ::GetProcAddress;
using ::GetModuleHandleA;
#else
extern "C" {
__declspec(dllimport) HMODULE_ __stdcall
LoadLibrary(
LPCTSTR_ lpFileName
extern "C" {
# ifdef _WIN64
typedef INT_PTR_ (WINAPI *FARPROC_)();
typedef INT_PTR_ (WINAPI *NEARPROC_)();
typedef INT_PTR_ (WINAPI *PROC_)();
# else
typedef int (WINAPI *FARPROC_)();
typedef int (WINAPI *NEARPROC_)();
typedef int (WINAPI *PROC_)();
# endif // _WIN64
# ifdef BOOST_NO_ANSI_APIS
__declspec(dllimport) HMODULE_ WINAPI
LoadLibraryW(
LPCWSTR_ lpFileName
);
__declspec(dllimport) BOOL_ __stdcall
__declspec(dllimport) HMODULE_ WINAPI
GetModuleHandleW(
LPCWSTR_ lpFileName
);
# else
__declspec(dllimport) HMODULE_ WINAPI
LoadLibraryA(
LPCSTR_ lpFileName
);
__declspec(dllimport) HMODULE_ WINAPI
GetModuleHandleA(
LPCSTR_ lpFileName
);
# endif
__declspec(dllimport) BOOL_ WINAPI
FreeLibrary(
HMODULE_ hModule
);
__declspec(dllimport) FARPROC_ __stdcall
__declspec(dllimport) FARPROC_ WINAPI
GetProcAddress(
HMODULE_ hModule,
LPCSTR_ lpProcName
);
__declspec(dllimport) FARPROC_ __stdcall
GetModuleHandleA(
LPCSTR_ lpProcName
);
}
}
#endif
}
}
}
#endif // BOOST_DETAIL_WINAPI_THREAD_HPP
#endif // BOOST_DETAIL_WINAPI_DLL_HPP

View File

@@ -24,14 +24,20 @@ namespace winapi
#if defined( BOOST_USE_WINDOWS_H )
using ::CloseHandle;
using ::DuplicateHandle;
const DWORD_ duplicate_close_source = DUPLICATE_CLOSE_SOURCE;
const DWORD_ duplicate_same_access = DUPLICATE_SAME_ACCESS;
const HANDLE_ invalid_handle_value = INVALID_HANDLE_VALUE;
#else
extern "C" {
__declspec(dllimport) int __stdcall
extern "C" {
__declspec(dllimport) int __stdcall
CloseHandle(void*);
__declspec(dllimport) int __stdcall
__declspec(dllimport) int __stdcall
DuplicateHandle(void*,void*,void*,void**,unsigned long,int,unsigned long);
}
const DWORD_ duplicate_close_source = 1;
const DWORD_ duplicate_same_access = 2;
const HANDLE_ invalid_handle_value = (HANDLE_)(-1);
#endif
}
}

View File

@@ -23,10 +23,9 @@ namespace winapi {
using ::GetCurrentProcessId;
#else
# ifndef UNDER_CE
extern "C" {
__declspec(dllimport) unsigned long __stdcall
GetCurrentProcessId(void);
}
extern "C" {
__declspec(dllimport) DWORD_ WINAPI GetCurrentProcessId(void);
}
# else
using ::GetCurrentProcessId;
# endif

View File

@@ -25,7 +25,26 @@ namespace winapi
typedef ::CRITICAL_SECTION CRITICAL_SECTION_;
typedef ::PAPCFUNC PAPCFUNC_;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
typedef ::INIT_ONCE INIT_ONCE_;
typedef ::PINIT_ONCE PINIT_ONCE_;
typedef ::LPINIT_ONCE LPINIT_ONCE_;
#define BOOST_DETAIL_WINAPI_INIT_ONCE_STATIC_INIT INIT_ONCE_STATIC_INIT
typedef ::PINIT_ONCE_FN PINIT_ONCE_FN_;
typedef ::SRWLOCK SRWLOCK_;
typedef ::PSRWLOCK PSRWLOCK_;
#define BOOST_DETAIL_WINAPI_SRWLOCK_INIT SRWLOCK_INIT
typedef ::CONDITION_VARIABLE CONDITION_VARIABLE_;
typedef ::PCONDITION_VARIABLE PCONDITION_VARIABLE_;
#define BOOST_DETAIL_WINAPI_CONDITION_VARIABLE_INIT CONDITION_VARIABLE_INIT
#endif
using ::InitializeCriticalSection;
#if BOOST_USE_WINAPI_VERSION >= 0x0403
using ::InitializeCriticalSectionAndSpinCount;
#endif
using ::EnterCriticalSection;
using ::TryEnterCriticalSection;
using ::LeaveCriticalSection;
@@ -33,14 +52,18 @@ namespace winapi
# ifdef BOOST_NO_ANSI_APIS
using ::CreateMutexW;
using ::OpenMutexW;
using ::CreateEventW;
using ::OpenEventW;
using ::CreateSemaphoreW;
using ::OpenSemaphoreW;
# else
using ::CreateMutexA;
using ::OpenMutexA;
using ::CreateEventA;
using ::OpenEventA;
using ::CreateSemaphoreA;
using ::OpenSemaphoreA;
# endif
using ::ReleaseMutex;
using ::ReleaseSemaphore;
@@ -50,17 +73,47 @@ namespace winapi
using ::WaitForSingleObject;
using ::QueueUserAPC;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
using ::InitOnceInitialize;
using ::InitOnceExecuteOnce;
using ::InitOnceBeginInitialize;
using ::InitOnceComplete;
using ::InitializeSRWLock;
using ::AcquireSRWLockExclusive;
using ::TryAcquireSRWLockExclusive;
using ::ReleaseSRWLockExclusive;
using ::AcquireSRWLockShared;
using ::TryAcquireSRWLockShared;
using ::ReleaseSRWLockShared;
using ::InitializeConditionVariable;
using ::WakeConditionVariable;
using ::WakeAllConditionVariable;
using ::SleepConditionVariableCS;
using ::SleepConditionVariableSRW;
#endif
const DWORD_ infinite = INFINITE;
const DWORD_ wait_abandoned = WAIT_ABANDONED;
const DWORD_ wait_object_0 = WAIT_OBJECT_0;
const DWORD_ wait_timeout = WAIT_TIMEOUT;
const DWORD_ wait_failed = WAIT_FAILED;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
const DWORD_ init_once_async = INIT_ONCE_ASYNC;
const DWORD_ init_once_check_only = INIT_ONCE_CHECK_ONLY;
const DWORD_ init_once_init_failed = INIT_ONCE_INIT_FAILED;
const DWORD_ init_once_ctx_reserved_bits = INIT_ONCE_CTX_RESERVED_BITS;
const ULONG_ condition_variable_lockmode_shared = CONDITION_VARIABLE_LOCKMODE_SHARED;
#endif
#else // defined( BOOST_USE_WINDOWS_H )
extern "C" {
struct CRITICAL_SECTION_
typedef struct CRITICAL_SECTION_
{
struct critical_section_debug * DebugInfo;
long LockCount;
@@ -72,73 +125,167 @@ extern "C" {
#else
unsigned long SpinCount;
#endif
};
}
*PCRITICAL_SECTION_;
__declspec(dllimport) void __stdcall
InitializeCriticalSection(CRITICAL_SECTION_ *);
__declspec(dllimport) void __stdcall
EnterCriticalSection(CRITICAL_SECTION_ *);
__declspec(dllimport) bool __stdcall
TryEnterCriticalSection(CRITICAL_SECTION_ *);
__declspec(dllimport) void __stdcall
LeaveCriticalSection(CRITICAL_SECTION_ *);
__declspec(dllimport) void __stdcall
DeleteCriticalSection(CRITICAL_SECTION_ *);
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
typedef union INIT_ONCE_
{
PVOID_ Ptr;
}
*PINIT_ONCE_, *LPINIT_ONCE_;
#define BOOST_DETAIL_WINAPI_INIT_ONCE_STATIC_INIT {0}
typedef BOOL_ (WINAPI *PINIT_ONCE_FN_)(PINIT_ONCE_ InitOnce, PVOID_ Parameter, PVOID_ *Context);
struct _SECURITY_ATTRIBUTES;
typedef struct SRWLOCK_
{
PVOID_ Ptr;
}
* PSRWLOCK_;
#define BOOST_DETAIL_WINAPI_SRWLOCK_INIT {0}
typedef struct CONDITION_VARIABLE_
{
PVOID_ Ptr;
}
* PCONDITION_VARIABLE_;
#define BOOST_DETAIL_WINAPI_CONDITION_VARIABLE_INIT {0}
#endif
__declspec(dllimport) void WINAPI
InitializeCriticalSection(PCRITICAL_SECTION_);
#if BOOST_USE_WINAPI_VERSION >= 0x0403
__declspec(dllimport) BOOL_ WINAPI
InitializeCriticalSectionAndSpinCount(CRITICAL_SECTION_* lpCS, DWORD_ dwSpinCount);
#endif
__declspec(dllimport) void WINAPI
EnterCriticalSection(PCRITICAL_SECTION_);
__declspec(dllimport) BOOL_ WINAPI
TryEnterCriticalSection(PCRITICAL_SECTION_);
__declspec(dllimport) void WINAPI
LeaveCriticalSection(PCRITICAL_SECTION_);
__declspec(dllimport) void WINAPI
DeleteCriticalSection(PCRITICAL_SECTION_);
struct _SECURITY_ATTRIBUTES;
# ifdef BOOST_NO_ANSI_APIS
__declspec(dllimport) void* __stdcall
CreateMutexW(_SECURITY_ATTRIBUTES*,int,wchar_t const*);
__declspec(dllimport) void* __stdcall
CreateSemaphoreW(_SECURITY_ATTRIBUTES*,long,long,wchar_t const*);
__declspec(dllimport) void* __stdcall
CreateEventW(_SECURITY_ATTRIBUTES*,int,int,wchar_t const*);
__declspec(dllimport) void* __stdcall
OpenEventW(unsigned long,int,wchar_t const*);
__declspec(dllimport) HANDLE_ WINAPI
CreateMutexW(_SECURITY_ATTRIBUTES*, BOOL_, LPCWSTR_);
__declspec(dllimport) HANDLE_ WINAPI
OpenMutexW(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCWSTR_ lpName);
__declspec(dllimport) HANDLE_ WINAPI
CreateSemaphoreW(_SECURITY_ATTRIBUTES*, LONG_, LONG_, LPCWSTR_);
__declspec(dllimport) HANDLE_ WINAPI
OpenSemaphoreW(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCWSTR_ lpName);
__declspec(dllimport) HANDLE_ WINAPI
CreateEventW(_SECURITY_ATTRIBUTES*, BOOL_, BOOL_, LPCWSTR_);
__declspec(dllimport) HANDLE_ WINAPI
OpenEventW(DWORD_, BOOL_, LPCWSTR_);
# else
__declspec(dllimport) void* __stdcall
CreateMutexA(_SECURITY_ATTRIBUTES*,int,char const*);
__declspec(dllimport) void* __stdcall
CreateSemaphoreA(_SECURITY_ATTRIBUTES*,long,long,char const*);
__declspec(dllimport) void* __stdcall
CreateEventA(_SECURITY_ATTRIBUTES*,int,int,char const*);
__declspec(dllimport) void* __stdcall
OpenEventA(unsigned long,int,char const*);
# endif
__declspec(dllimport) int __stdcall
ReleaseMutex(void*);
__declspec(dllimport) unsigned long __stdcall
WaitForSingleObject(void*,unsigned long);
__declspec(dllimport) unsigned long __stdcall
WaitForMultipleObjects(unsigned long nCount,
void* const * lpHandles,
int bWaitAll,
unsigned long dwMilliseconds);
__declspec(dllimport) int __stdcall
ReleaseSemaphore(void*,long,long*);
typedef void (__stdcall *PAPCFUNC8)(ULONG_PTR_);
__declspec(dllimport) unsigned long __stdcall
QueueUserAPC(PAPCFUNC8,void*,ULONG_PTR_);
# ifndef UNDER_CE
__declspec(dllimport) int __stdcall
SetEvent(void*);
__declspec(dllimport) int __stdcall
ResetEvent(void*);
# else
using ::SetEvent;
using ::ResetEvent;
__declspec(dllimport) HANDLE_ WINAPI
CreateMutexA(_SECURITY_ATTRIBUTES*, BOOL_, LPCSTR_);
__declspec(dllimport) HANDLE_ WINAPI
OpenMutexA(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCSTR_ lpName);
__declspec(dllimport) HANDLE_ WINAPI
CreateSemaphoreA(_SECURITY_ATTRIBUTES*, LONG_, LONG_, LPCSTR_);
__declspec(dllimport) HANDLE_ WINAPI
OpenSemaphoreA(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCSTR_ lpName);
__declspec(dllimport) HANDLE_ WINAPI
CreateEventA(_SECURITY_ATTRIBUTES*, BOOL_, BOOL_, LPCSTR_);
__declspec(dllimport) HANDLE_ WINAPI
OpenEventA(DWORD_, BOOL_, LPCSTR_);
# endif
__declspec(dllimport) BOOL_ WINAPI
ReleaseMutex(HANDLE_);
__declspec(dllimport) DWORD_ WINAPI
WaitForSingleObject(HANDLE_, DWORD_);
__declspec(dllimport) DWORD_ WINAPI
WaitForMultipleObjects(DWORD_ nCount,
HANDLE_ const * lpHandles,
BOOL_ bWaitAll,
DWORD_ dwMilliseconds);
__declspec(dllimport) BOOL_ WINAPI
ReleaseSemaphore(HANDLE_, LONG_, LONG_*);
__declspec(dllimport) BOOL_ WINAPI
SetEvent(HANDLE_);
__declspec(dllimport) BOOL_ WINAPI
ResetEvent(HANDLE_);
typedef void (__stdcall *PAPCFUNC_)(ULONG_PTR_);
__declspec(dllimport) DWORD_ WINAPI
QueueUserAPC(PAPCFUNC_, HANDLE_, ULONG_PTR_);
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
__declspec(dllimport) void WINAPI InitOnceInitialize(PINIT_ONCE_);
__declspec(dllimport) BOOL_ WINAPI InitOnceExecuteOnce(PINIT_ONCE_ InitOnce, PINIT_ONCE_FN_ InitFn, PVOID_ Parameter, LPVOID_* Context);
__declspec(dllimport) BOOL_ WINAPI InitOnceBeginInitialize(LPINIT_ONCE_ lpInitOnce, DWORD_ dwFlags, BOOL_* fPending, LPVOID_* lpContext);
__declspec(dllimport) BOOL_ WINAPI InitOnceComplete(LPINIT_ONCE_ lpInitOnce, DWORD_ dwFlags, LPVOID_* lpContext);
__declspec(dllimport) void WINAPI InitializeSRWLock(PSRWLOCK_ SRWLock);
__declspec(dllimport) void WINAPI AcquireSRWLockExclusive(PSRWLOCK_ SRWLock);
__declspec(dllimport) BOOLEAN_ WINAPI TryAcquireSRWLockExclusive(PSRWLOCK_ SRWLock);
__declspec(dllimport) void WINAPI ReleaseSRWLockExclusive(PSRWLOCK_ SRWLock);
__declspec(dllimport) void WINAPI AcquireSRWLockShared(PSRWLOCK_ SRWLock);
__declspec(dllimport) BOOLEAN_ WINAPI TryAcquireSRWLockShared(PSRWLOCK_ SRWLock);
__declspec(dllimport) void WINAPI ReleaseSRWLockShared(PSRWLOCK_ SRWLock);
__declspec(dllimport) void WINAPI InitializeConditionVariable(PCONDITION_VARIABLE_ ConditionVariable);
__declspec(dllimport) void WINAPI WakeConditionVariable(PCONDITION_VARIABLE_ ConditionVariable);
__declspec(dllimport) void WINAPI WakeAllConditionVariable(PCONDITION_VARIABLE_ ConditionVariable);
__declspec(dllimport) BOOL_ WINAPI SleepConditionVariableCS(PCONDITION_VARIABLE_ ConditionVariable, PCRITICAL_SECTION_ CriticalSection, DWORD_ dwMilliseconds);
__declspec(dllimport) BOOL_ WINAPI SleepConditionVariableSRW(PCONDITION_VARIABLE_ ConditionVariable, PSRWLOCK_ SRWLock, DWORD_ dwMilliseconds, ULONG_ Flags);
#endif
} // extern "C"
const DWORD_ infinite = (DWORD_)0xFFFFFFFF;
const DWORD_ wait_abandoned = 0x00000080L;
const DWORD_ wait_object_0 = 0x00000000L;
const DWORD_ wait_timeout = 0x00000102L;
const DWORD_ wait_failed = (DWORD_)0xFFFFFFFF;
const DWORD_ infinite = (DWORD_)0xFFFFFFFF;
const DWORD_ wait_abandoned = 0x00000080L;
const DWORD_ wait_object_0 = 0x00000000L;
const DWORD_ wait_timeout = 0x00000102L;
const DWORD_ wait_failed = (DWORD_)0xFFFFFFFF;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
const DWORD_ init_once_async = 0x00000002UL;
const DWORD_ init_once_check_only = 0x00000001UL;
const DWORD_ init_once_init_failed = 0x00000004UL;
const DWORD_ init_once_ctx_reserved_bits = 2;
const ULONG_ condition_variable_lockmode_shared = 0x00000001;
#endif
#endif // defined( BOOST_USE_WINDOWS_H )
const DWORD_ max_non_infinite_wait = (DWORD_)0xFFFFFFFE;
BOOST_FORCEINLINE HANDLE_ create_anonymous_mutex(_SECURITY_ATTRIBUTES* lpAttributes, BOOL_ bInitialOwner)
{
#ifdef BOOST_NO_ANSI_APIS
return CreateMutexW(lpAttributes, bInitialOwner, 0);
#else
return CreateMutexA(lpAttributes, bInitialOwner, 0);
#endif
}
BOOST_FORCEINLINE HANDLE_ create_anonymous_semaphore(_SECURITY_ATTRIBUTES* lpAttributes, LONG_ lInitialCount, LONG_ lMaximumCount)
{
#ifdef BOOST_NO_ANSI_APIS
return CreateSemaphoreW(lpAttributes, lInitialCount, lMaximumCount, 0);
#else
return CreateSemaphoreA(lpAttributes, lInitialCount, lMaximumCount, 0);
#endif
}
BOOST_FORCEINLINE HANDLE_ create_anonymous_event(_SECURITY_ATTRIBUTES* lpAttributes, BOOL_ bManualReset, BOOL_ bInitialState)
{
#ifdef BOOST_NO_ANSI_APIS
return CreateEventW(lpAttributes, bManualReset, bInitialState, 0);
#else
return CreateEventA(lpAttributes, bManualReset, bInitialState, 0);
#endif
}
}
}
}

View File

@@ -26,21 +26,21 @@ namespace winapi
using ::GetCurrentThreadId;
using ::SleepEx;
using ::Sleep;
using ::SwitchToThread;
#else
extern "C" {
extern "C" {
# ifndef UNDER_CE
__declspec(dllimport) unsigned long __stdcall
GetCurrentThreadId(void);
__declspec(dllimport) unsigned long __stdcall
SleepEx(unsigned long,int);
__declspec(dllimport) void __stdcall
Sleep(unsigned long);
__declspec(dllimport) DWORD_ WINAPI GetCurrentThreadId(void);
__declspec(dllimport) DWORD_ WINAPI SleepEx(DWORD_, BOOL_);
__declspec(dllimport) void WINAPI Sleep(DWORD_);
__declspec(dllimport) BOOL_ WINAPI SwitchToThread(void);
#else
using ::GetCurrentThreadId;
using ::SleepEx;
using ::Sleep;
#endif
}
using ::SwitchToThread;
#endif
}
#endif
}
}

View File

@@ -0,0 +1,96 @@
// thread_pool.hpp --------------------------------------------------------------//
// Copyright 2013 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_THREAD_POOL_HPP
#define BOOST_DETAIL_WINAPI_THREAD_POOL_HPP
#include <boost/detail/winapi/basic_types.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN2K
namespace boost
{
namespace detail
{
namespace winapi
{
#if defined( BOOST_USE_WINDOWS_H )
typedef ::WAITORTIMERCALLBACKFUNC WAITORTIMERCALLBACKFUNC_;
typedef ::WAITORTIMERCALLBACK WAITORTIMERCALLBACK_;
using ::RegisterWaitForSingleObject;
using ::UnregisterWait;
using ::UnregisterWaitEx;
const ULONG_ wt_execute_default = WT_EXECUTEDEFAULT;
const ULONG_ wt_execute_in_io_thread = WT_EXECUTEINIOTHREAD;
const ULONG_ wt_execute_in_ui_thread = WT_EXECUTEINUITHREAD;
const ULONG_ wt_execute_in_wait_thread = WT_EXECUTEINWAITTHREAD;
const ULONG_ wt_execute_only_once = WT_EXECUTEONLYONCE;
const ULONG_ wt_execute_in_timer_thread = WT_EXECUTEINTIMERTHREAD;
const ULONG_ wt_execute_long_function = WT_EXECUTELONGFUNCTION;
const ULONG_ wt_execute_in_persistent_io_thread = WT_EXECUTEINPERSISTENTIOTHREAD;
const ULONG_ wt_execute_in_persistent_thread = WT_EXECUTEINPERSISTENTTHREAD;
const ULONG_ wt_transfer_impersonation = WT_TRANSFER_IMPERSONATION;
inline ULONG_ wt_set_max_threadpool_threads(ULONG_ flags, ULONG_ limit)
{
return WT_SET_MAX_THREADPOOL_THREADS(flags, limit);
}
#else
extern "C" {
typedef void (NTAPI* WAITORTIMERCALLBACKFUNC_) (PVOID_, BOOLEAN_);
typedef WAITORTIMERCALLBACKFUNC_ WAITORTIMERCALLBACK_;
__declspec(dllimport) BOOL_ WINAPI RegisterWaitForSingleObject
(
HANDLE_* phNewWaitObject,
HANDLE_ hObject,
WAITORTIMERCALLBACK_ Callback,
PVOID_ Context,
ULONG_ dwMilliseconds,
ULONG_ dwFlags
);
__declspec(dllimport) BOOL_ WINAPI UnregisterWait(HANDLE_ WaitHandle);
__declspec(dllimport) BOOL_ WINAPI UnregisterWaitEx(HANDLE_ WaitHandle, HANDLE_ CompletionEvent);
} // extern "C"
const ULONG_ wt_execute_default = 0x00000000;
const ULONG_ wt_execute_in_io_thread = 0x00000001;
const ULONG_ wt_execute_in_ui_thread = 0x00000002;
const ULONG_ wt_execute_in_wait_thread = 0x00000004;
const ULONG_ wt_execute_only_once = 0x00000008;
const ULONG_ wt_execute_in_timer_thread = 0x00000020;
const ULONG_ wt_execute_long_function = 0x00000010;
const ULONG_ wt_execute_in_persistent_io_thread = 0x00000040;
const ULONG_ wt_execute_in_persistent_thread = 0x00000080;
const ULONG_ wt_transfer_impersonation = 0x00000100;
inline ULONG_ wt_set_max_threadpool_threads(ULONG_ flags, ULONG_ limit)
{
return flags | (limit << 16);
}
#endif
}
}
}
#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN2K
#endif // BOOST_DETAIL_WINAPI_THREAD_POOL_HPP

View File

@@ -18,7 +18,9 @@
namespace boost {
namespace detail {
namespace winapi {
#if defined( BOOST_USE_WINDOWS_H )
typedef FILETIME FILETIME_;
typedef PFILETIME PFILETIME_;
typedef LPFILETIME LPFILETIME_;
@@ -33,8 +35,12 @@ namespace winapi {
using ::GetSystemTime;
using ::SystemTimeToFileTime;
using ::GetTickCount;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
using ::GetTickCount64;
#endif
#else
extern "C" {
typedef struct _FILETIME {
DWORD_ dwLowDateTime;
@@ -66,7 +72,12 @@ extern "C" {
FILETIME_* lpFileTime);
__declspec(dllimport) DWORD_ WINAPI
GetTickCount();
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
__declspec(dllimport) ULONGLONG_ WINAPI
GetTickCount64();
#endif
}
#endif
#ifndef BOOST_HAS_GETSYSTEMTIMEASFILETIME

View File

@@ -0,0 +1,49 @@
// tls.hpp --------------------------------------------------------------//
// Copyright 2013 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_TLS_HPP
#define BOOST_DETAIL_WINAPI_TLS_HPP
#include <boost/detail/winapi/basic_types.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
namespace boost
{
namespace detail
{
namespace winapi
{
#if defined( BOOST_USE_WINDOWS_H )
using ::TlsAlloc;
using ::TlsGetValue;
using ::TlsSetValue;
using ::TlsFree;
const DWORD_ tls_out_of_indexes = TLS_OUT_OF_INDEXES;
#else
extern "C" {
__declspec(dllimport) DWORD_ WINAPI TlsAlloc(void);
__declspec(dllimport) LPVOID_ WINAPI TlsGetValue(DWORD_ dwTlsIndex);
__declspec(dllimport) BOOL_ WINAPI TlsSetValue(DWORD_ dwTlsIndex, LPVOID_ lpTlsValue);
__declspec(dllimport) BOOL_ WINAPI TlsFree(DWORD_ dwTlsIndex);
}
const DWORD_ tls_out_of_indexes = 0xFFFFFFFF;
#endif
}
}
}
#endif // BOOST_DETAIL_WINAPI_TLS_HPP

View File

@@ -0,0 +1,110 @@
// waitable_timer.hpp --------------------------------------------------------------//
// Copyright 2013 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_WAITABLE_TIMER_HPP
#define BOOST_DETAIL_WINAPI_WAITABLE_TIMER_HPP
#include <boost/detail/winapi/basic_types.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
namespace boost
{
namespace detail
{
namespace winapi
{
#if defined( BOOST_USE_WINDOWS_H )
typedef ::PTIMERAPCROUTINE PTIMERAPCROUTINE_;
# ifdef BOOST_NO_ANSI_APIS
using ::CreateWaitableTimerW;
using ::OpenWaitableTimerW;
# else
using ::CreateWaitableTimerA;
using ::OpenWaitableTimerA;
# endif
using ::SetWaitableTimer;
using ::CancelWaitableTimer;
#else
extern "C" {
struct _SECURITY_ATTRIBUTES;
typedef void (WINAPI* PTIMERAPCROUTINE_)
(
LPVOID_ lpArgToCompletionRoutine,
DWORD_ dwTimerLowValue,
DWORD_ dwTimerHighValue
);
# ifdef BOOST_NO_ANSI_APIS
__declspec(dllimport) HANDLE_ WINAPI CreateWaitableTimerW
(
_SECURITY_ATTRIBUTES* lpTimerAttributes,
BOOL_ bManualReset,
LPCWSTR_ lpTimerName
);
__declspec(dllimport) HANDLE_ WINAPI OpenWaitableTimerW
(
DWORD_ dwDesiredAccess,
BOOL_ bInheritHandle,
LPCWSTR_ lpTimerName
);
# else
__declspec(dllimport) HANDLE_ WINAPI CreateWaitableTimerA
(
_SECURITY_ATTRIBUTES* lpTimerAttributes,
BOOL_ bManualReset,
LPCSTR_ lpTimerName
);
__declspec(dllimport) HANDLE_ WINAPI OpenWaitableTimerA
(
DWORD_ dwDesiredAccess,
BOOL_ bInheritHandle,
LPCSTR_ lpTimerName
);
# endif
__declspec(dllimport) BOOL_ WINAPI SetWaitableTimer
(
HANDLE_ hTimer,
const LARGE_INTEGER_ *lpDueTime,
LONG_ lPeriod,
PTIMERAPCROUTINE_ pfnCompletionRoutine,
LPVOID_ lpArgToCompletionRoutine,
BOOL_ fResume
);
__declspec(dllimport) BOOL_ WINAPI CancelWaitableTimer(HANDLE_ hTimer);
}
#endif
BOOST_FORCEINLINE HANDLE_ create_anonymous_waitable_timer(_SECURITY_ATTRIBUTES* lpTimerAttributes, BOOL_ bManualReset)
{
#ifdef BOOST_NO_ANSI_APIS
return CreateWaitableTimerW(lpTimerAttributes, bManualReset, 0);
#else
return CreateWaitableTimerA(lpTimerAttributes, bManualReset, 0);
#endif
}
}
}
}
#endif // BOOST_DETAIL_WINAPI_WAITABLE_TIMER_HPP