stabilize build system: depends, installer, boost/bdb fixes, cross targets groundwork

This commit is contained in:
2026-02-24 18:38:47 +00:00
parent da8c28aaeb
commit 65cb2619a7
13106 changed files with 2484322 additions and 1804 deletions
@@ -0,0 +1,82 @@
// (C) Copyright Jeremy Siek 2001.
// Distributed under the Boost Software License, Version 1.0. (See accompany-
// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
#ifndef BOOST_ALGORITHM_HPP
# define BOOST_ALGORITHM_HPP
# include <boost/detail/iterator.hpp>
// Algorithms on sequences
//
// The functions in this file have not yet gone through formal
// review, and are subject to change. This is a work in progress.
// They have been checked into the detail directory because
// there are some graph algorithms that use these functions.
#include <algorithm>
#include <vector>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/algorithm/copy.hpp>
#include <boost/range/algorithm/equal.hpp>
#include <boost/range/algorithm/sort.hpp>
#include <boost/range/algorithm/stable_sort.hpp>
#include <boost/range/algorithm/find_if.hpp>
#include <boost/range/algorithm/count.hpp>
#include <boost/range/algorithm/count_if.hpp>
#include <boost/range/algorithm_ext/is_sorted.hpp>
#include <boost/range/algorithm_ext/iota.hpp>
namespace boost {
template <typename InputIterator, typename Predicate>
bool any_if(InputIterator first, InputIterator last, Predicate p)
{
return std::find_if(first, last, p) != last;
}
template <typename Container, typename Predicate>
bool any_if(const Container& c, Predicate p)
{
return any_if(boost::begin(c), boost::end(c), p);
}
template <typename InputIterator, typename T>
bool container_contains(InputIterator first, InputIterator last, T value)
{
return std::find(first, last, value) != last;
}
template <typename Container, typename T>
bool container_contains(const Container& c, const T& value)
{
return container_contains(boost::begin(c), boost::end(c), value);
}
} // namespace boost
#endif // BOOST_ALGORITHM_HPP
@@ -0,0 +1,187 @@
/* 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)
*
* See Boost website at http://www.boost.org/
*/
#ifndef BOOST_DETAIL_ALLOCATOR_UTILITIES_HPP
#define BOOST_DETAIL_ALLOCATOR_UTILITIES_HPP
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/detail/workaround.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/type_traits/is_same.hpp>
#include <cstddef>
#include <memory>
#include <new>
namespace boost{
namespace detail{
/* Allocator adaption layer. Some stdlibs provide allocators without rebind
* and template ctors. These facilities are simulated with the external
* template class rebind_to and the aid of partial_std_allocator_wrapper.
*/
namespace allocator{
/* partial_std_allocator_wrapper inherits the functionality of a std
* allocator while providing a templatized ctor and other bits missing
* in some stdlib implementation or another.
*/
template<typename Type>
class partial_std_allocator_wrapper:public std::allocator<Type>
{
public:
/* Oddly enough, STLport does not define std::allocator<void>::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<typename Other>
partial_std_allocator_wrapper(const partial_std_allocator_wrapper<Other>&){}
partial_std_allocator_wrapper(const std::allocator<Type>& x):
std::allocator<Type>(x)
{
};
#if defined(BOOST_DINKUMWARE_STDLIB)
/* Dinkumware guys didn't provide a means to call allocate() without
* supplying a hint, in disagreement with the standard.
*/
Type* allocate(std::size_t n,const void* hint=0)
{
std::allocator<Type>& a=*this;
return a.allocate(n,hint);
}
#endif
};
/* Detects whether a given allocator belongs to a defective stdlib not
* having the required member templates.
* Note that it does not suffice to check the Boost.Config stdlib
* macros, as the user might have passed a custom, compliant allocator.
* The checks also considers partial_std_allocator_wrapper to be
* a standard defective allocator.
*/
#if defined(BOOST_NO_STD_ALLOCATOR)&&\
(defined(BOOST_HAS_PARTIAL_STD_ALLOCATOR)||defined(BOOST_DINKUMWARE_STDLIB))
template<typename Allocator>
struct is_partial_std_allocator
{
BOOST_STATIC_CONSTANT(bool,
value=
(is_same<
std::allocator<BOOST_DEDUCED_TYPENAME Allocator::value_type>,
Allocator
>::value)||
(is_same<
partial_std_allocator_wrapper<
BOOST_DEDUCED_TYPENAME Allocator::value_type>,
Allocator
>::value));
};
#else
template<typename Allocator>
struct is_partial_std_allocator
{
BOOST_STATIC_CONSTANT(bool,value=false);
};
#endif
/* rebind operations for defective std allocators */
template<typename Allocator,typename Type>
struct partial_std_allocator_rebind_to
{
typedef partial_std_allocator_wrapper<Type> type;
};
/* rebind operation in all other cases */
template<typename Allocator>
struct rebinder
{
template<typename Type>
struct result
{
typedef typename Allocator::BOOST_NESTED_TEMPLATE
rebind<Type>::other other;
};
};
template<typename Allocator,typename Type>
struct compliant_allocator_rebind_to
{
typedef typename rebinder<Allocator>::
BOOST_NESTED_TEMPLATE result<Type>::other type;
};
/* rebind front-end */
template<typename Allocator,typename Type>
struct rebind_to:
mpl::eval_if_c<
is_partial_std_allocator<Allocator>::value,
partial_std_allocator_rebind_to<Allocator,Type>,
compliant_allocator_rebind_to<Allocator,Type>
>
{
};
/* allocator-independent versions of construct and destroy */
template<typename Type>
void construct(void* p,const Type& t)
{
new (p) Type(t);
}
#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
/* MSVC++ issues spurious warnings about unreferencend formal parameters
* in destroy<Type> when Type is a class with trivial dtor.
*/
#pragma warning(push)
#pragma warning(disable:4100)
#endif
template<typename Type>
void destroy(const Type* p)
{
#if BOOST_WORKAROUND(__SUNPRO_CC,BOOST_TESTED_AT(0x590))
const_cast<Type*>(p)->~Type();
#else
p->~Type();
#endif
}
#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
#pragma warning(pop)
#endif
} /* namespace boost::detail::allocator */
} /* namespace boost::detail */
} /* namespace boost */
#endif
@@ -0,0 +1,21 @@
#ifndef BOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED
#define BOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
//
// boost/detail/atomic_count.hpp - thread/SMP safe reference counter
//
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
//
// 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/atomic_count.hpp>
#endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED
@@ -0,0 +1,19 @@
// Copyright (C) 2013 Vicente J. Botet Escriba
//
// 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_INTEL)
#pragma pop_macro("atomic_compare_exchange")
#pragma pop_macro("atomic_compare_exchange_explicit")
#pragma pop_macro("atomic_exchange")
#pragma pop_macro("atomic_exchange_explicit")
#pragma pop_macro("atomic_is_lock_free")
#pragma pop_macro("atomic_load")
#pragma pop_macro("atomic_load_explicit")
#pragma pop_macro("atomic_store")
#pragma pop_macro("atomic_store_explicit")
#endif // #if defined(BOOST_INTEL)
@@ -0,0 +1,39 @@
// Copyright (C) 2013 Vicente J. Botet Escriba
//
// 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_INTEL)
#pragma push_macro("atomic_compare_exchange")
#undef atomic_compare_exchange
#pragma push_macro("atomic_compare_exchange_explicit")
#undef atomic_compare_exchange_explicit
#pragma push_macro("atomic_exchange")
#undef atomic_exchange
#pragma push_macro("atomic_exchange_explicit")
#undef atomic_exchange_explicit
#pragma push_macro("atomic_is_lock_free")
#undef atomic_is_lock_free
#pragma push_macro("atomic_load")
#undef atomic_load
#pragma push_macro("atomic_load_explicit")
#undef atomic_load_explicit
#pragma push_macro("atomic_store")
#undef atomic_store
#pragma push_macro("atomic_store_explicit")
#undef atomic_store_explicit
#endif // #if defined(BOOST_INTEL)
@@ -0,0 +1,139 @@
//-----------------------------------------------------------------------------
// boost detail/templated_streams.hpp header file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2013 John Maddock, Antony Polukhin
//
//
// 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)
#ifndef BOOST_DETAIL_BASIC_POINTERBUF_HPP
#define BOOST_DETAIL_BASIC_POINTERBUF_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER)
# pragma once
#endif
#include "boost/config.hpp"
#include <streambuf>
namespace boost { namespace detail {
//
// class basic_pointerbuf:
// acts as a stream buffer which wraps around a pair of pointers:
//
template <class charT, class BufferT >
class basic_pointerbuf : public BufferT {
protected:
typedef BufferT base_type;
typedef basic_pointerbuf<charT, BufferT> this_type;
typedef typename base_type::int_type int_type;
typedef typename base_type::char_type char_type;
typedef typename base_type::pos_type pos_type;
typedef ::std::streamsize streamsize;
typedef typename base_type::off_type off_type;
public:
basic_pointerbuf() : base_type() { setbuf(0, 0); }
const charT* getnext() { return this->gptr(); }
#ifndef BOOST_NO_USING_TEMPLATE
using base_type::pptr;
using base_type::pbase;
#else
charT* pptr() const { return base_type::pptr(); }
charT* pbase() const { return base_type::pbase(); }
#endif
protected:
// VC mistakenly assumes that `setbuf` and other functions are not referenced.
// Marking those functions with `inline` suppresses the warnings.
// There must be no harm from marking virtual functions as inline: inline virtual
// call can be inlined ONLY when the compiler knows the "exact class".
inline base_type* setbuf(char_type* s, streamsize n);
inline typename this_type::pos_type seekpos(pos_type sp, ::std::ios_base::openmode which);
inline typename this_type::pos_type seekoff(off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which);
private:
basic_pointerbuf& operator=(const basic_pointerbuf&);
basic_pointerbuf(const basic_pointerbuf&);
};
template<class charT, class BufferT>
BufferT*
basic_pointerbuf<charT, BufferT>::setbuf(char_type* s, streamsize n)
{
this->setg(s, s, s + n);
return this;
}
template<class charT, class BufferT>
typename basic_pointerbuf<charT, BufferT>::pos_type
basic_pointerbuf<charT, BufferT>::seekoff(off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which)
{
typedef typename boost::int_t<sizeof(way) * CHAR_BIT>::least cast_type;
if(which & ::std::ios_base::out)
return pos_type(off_type(-1));
std::ptrdiff_t size = this->egptr() - this->eback();
std::ptrdiff_t pos = this->gptr() - this->eback();
charT* g = this->eback();
switch(static_cast<cast_type>(way))
{
case ::std::ios_base::beg:
if((off < 0) || (off > size))
return pos_type(off_type(-1));
else
this->setg(g, g + off, g + size);
break;
case ::std::ios_base::end:
if((off < 0) || (off > size))
return pos_type(off_type(-1));
else
this->setg(g, g + size - off, g + size);
break;
case ::std::ios_base::cur:
{
std::ptrdiff_t newpos = static_cast<std::ptrdiff_t>(pos + off);
if((newpos < 0) || (newpos > size))
return pos_type(off_type(-1));
else
this->setg(g, g + newpos, g + size);
break;
}
default: ;
}
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable:4244)
#endif
return static_cast<pos_type>(this->gptr() - this->eback());
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
}
template<class charT, class BufferT>
typename basic_pointerbuf<charT, BufferT>::pos_type
basic_pointerbuf<charT, BufferT>::seekpos(pos_type sp, ::std::ios_base::openmode which)
{
if(which & ::std::ios_base::out)
return pos_type(off_type(-1));
off_type size = static_cast<off_type>(this->egptr() - this->eback());
charT* g = this->eback();
if(off_type(sp) <= size)
{
this->setg(g, g + off_type(sp), g + size);
}
return pos_type(off_type(-1));
}
}} // namespace boost::detail
#endif // BOOST_DETAIL_BASIC_POINTERBUF_HPP
@@ -0,0 +1,216 @@
// Copyright (c) 2000 David Abrahams.
// 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)
//
// Copyright (c) 1994
// Hewlett-Packard Company
//
// Permission to use, copy, modify, distribute and sell this software
// and its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appear in all copies and
// that both that copyright notice and this permission notice appear
// in supporting documentation. Hewlett-Packard Company makes no
// representations about the suitability of this software for any
// purpose. It is provided "as is" without express or implied warranty.
//
// Copyright (c) 1996
// Silicon Graphics Computer Systems, Inc.
//
// Permission to use, copy, modify, distribute and sell this software
// and its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appear in all copies and
// that both that copyright notice and this permission notice appear
// in supporting documentation. Silicon Graphics makes no
// representations about the suitability of this software for any
// purpose. It is provided "as is" without express or implied warranty.
//
#ifndef BINARY_SEARCH_DWA_122600_H_
# define BINARY_SEARCH_DWA_122600_H_
# include <boost/detail/iterator.hpp>
# include <utility>
namespace boost { namespace detail {
template <class ForwardIter, class Tp>
ForwardIter lower_bound(ForwardIter first, ForwardIter last,
const Tp& val)
{
typedef detail::iterator_traits<ForwardIter> traits;
typename traits::difference_type len = boost::detail::distance(first, last);
typename traits::difference_type half;
ForwardIter middle;
while (len > 0) {
half = len >> 1;
middle = first;
std::advance(middle, half);
if (*middle < val) {
first = middle;
++first;
len = len - half - 1;
}
else
len = half;
}
return first;
}
template <class ForwardIter, class Tp, class Compare>
ForwardIter lower_bound(ForwardIter first, ForwardIter last,
const Tp& val, Compare comp)
{
typedef detail::iterator_traits<ForwardIter> traits;
typename traits::difference_type len = boost::detail::distance(first, last);
typename traits::difference_type half;
ForwardIter middle;
while (len > 0) {
half = len >> 1;
middle = first;
std::advance(middle, half);
if (comp(*middle, val)) {
first = middle;
++first;
len = len - half - 1;
}
else
len = half;
}
return first;
}
template <class ForwardIter, class Tp>
ForwardIter upper_bound(ForwardIter first, ForwardIter last,
const Tp& val)
{
typedef detail::iterator_traits<ForwardIter> traits;
typename traits::difference_type len = boost::detail::distance(first, last);
typename traits::difference_type half;
ForwardIter middle;
while (len > 0) {
half = len >> 1;
middle = first;
std::advance(middle, half);
if (val < *middle)
len = half;
else {
first = middle;
++first;
len = len - half - 1;
}
}
return first;
}
template <class ForwardIter, class Tp, class Compare>
ForwardIter upper_bound(ForwardIter first, ForwardIter last,
const Tp& val, Compare comp)
{
typedef detail::iterator_traits<ForwardIter> traits;
typename traits::difference_type len = boost::detail::distance(first, last);
typename traits::difference_type half;
ForwardIter middle;
while (len > 0) {
half = len >> 1;
middle = first;
std::advance(middle, half);
if (comp(val, *middle))
len = half;
else {
first = middle;
++first;
len = len - half - 1;
}
}
return first;
}
template <class ForwardIter, class Tp>
std::pair<ForwardIter, ForwardIter>
equal_range(ForwardIter first, ForwardIter last, const Tp& val)
{
typedef detail::iterator_traits<ForwardIter> traits;
typename traits::difference_type len = boost::detail::distance(first, last);
typename traits::difference_type half;
ForwardIter middle, left, right;
while (len > 0) {
half = len >> 1;
middle = first;
std::advance(middle, half);
if (*middle < val) {
first = middle;
++first;
len = len - half - 1;
}
else if (val < *middle)
len = half;
else {
left = boost::detail::lower_bound(first, middle, val);
std::advance(first, len);
right = boost::detail::upper_bound(++middle, first, val);
return std::pair<ForwardIter, ForwardIter>(left, right);
}
}
return std::pair<ForwardIter, ForwardIter>(first, first);
}
template <class ForwardIter, class Tp, class Compare>
std::pair<ForwardIter, ForwardIter>
equal_range(ForwardIter first, ForwardIter last, const Tp& val,
Compare comp)
{
typedef detail::iterator_traits<ForwardIter> traits;
typename traits::difference_type len = boost::detail::distance(first, last);
typename traits::difference_type half;
ForwardIter middle, left, right;
while (len > 0) {
half = len >> 1;
middle = first;
std::advance(middle, half);
if (comp(*middle, val)) {
first = middle;
++first;
len = len - half - 1;
}
else if (comp(val, *middle))
len = half;
else {
left = boost::detail::lower_bound(first, middle, val, comp);
std::advance(first, len);
right = boost::detail::upper_bound(++middle, first, val, comp);
return std::pair<ForwardIter, ForwardIter>(left, right);
}
}
return std::pair<ForwardIter, ForwardIter>(first, first);
}
template <class ForwardIter, class Tp>
bool binary_search(ForwardIter first, ForwardIter last,
const Tp& val) {
ForwardIter i = boost::detail::lower_bound(first, last, val);
return i != last && !(val < *i);
}
template <class ForwardIter, class Tp, class Compare>
bool binary_search(ForwardIter first, ForwardIter last,
const Tp& val,
Compare comp) {
ForwardIter i = boost::detail::lower_bound(first, last, val, comp);
return i != last && !comp(val, *i);
}
}} // namespace boost::detail
#endif // BINARY_SEARCH_DWA_122600_H_
@@ -0,0 +1,47 @@
// boost/detail/bitmask.hpp ------------------------------------------------//
// Copyright Beman Dawes 2006
// Distributed under the Boost Software License, Version 1.0
// http://www.boost.org/LICENSE_1_0.txt
// Usage: enum foo { a=1, b=2, c=4 };
// BOOST_BITMASK( foo );
//
// void f( foo arg );
// ...
// f( a | c );
#ifndef BOOST_BITMASK_HPP
#define BOOST_BITMASK_HPP
#include <boost/cstdint.hpp>
#define BOOST_BITMASK(Bitmask) \
\
inline Bitmask operator| (Bitmask x , Bitmask y ) \
{ return static_cast<Bitmask>( static_cast<boost::int_least32_t>(x) \
| static_cast<boost::int_least32_t>(y)); } \
\
inline Bitmask operator& (Bitmask x , Bitmask y ) \
{ return static_cast<Bitmask>( static_cast<boost::int_least32_t>(x) \
& static_cast<boost::int_least32_t>(y)); } \
\
inline Bitmask operator^ (Bitmask x , Bitmask y ) \
{ return static_cast<Bitmask>( static_cast<boost::int_least32_t>(x) \
^ static_cast<boost::int_least32_t>(y)); } \
\
inline Bitmask operator~ (Bitmask x ) \
{ return static_cast<Bitmask>(~static_cast<boost::int_least32_t>(x)); } \
\
inline Bitmask & operator&=(Bitmask & x , Bitmask y) \
{ x = x & y ; return x ; } \
\
inline Bitmask & operator|=(Bitmask & x , Bitmask y) \
{ x = x | y ; return x ; } \
\
inline Bitmask & operator^=(Bitmask & x , Bitmask y) \
{ x = x ^ y ; return x ; }
#endif // BOOST_BITMASK_HPP
@@ -0,0 +1,172 @@
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
// Use, modification and distribution are subject to 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).
//
// See http://www.boost.org/libs/utility for most recent version including documentation.
// call_traits: defines typedefs for function usage
// (see libs/utility/call_traits.htm)
/* Release notes:
23rd July 2000:
Fixed array specialization. (JM)
Added Borland specific fixes for reference types
(issue raised by Steve Cleary).
*/
#ifndef BOOST_DETAIL_CALL_TRAITS_HPP
#define BOOST_DETAIL_CALL_TRAITS_HPP
#ifndef BOOST_CONFIG_HPP
#include <boost/config.hpp>
#endif
#include <cstddef>
#include <boost/type_traits/is_arithmetic.hpp>
#include <boost/type_traits/is_enum.hpp>
#include <boost/type_traits/is_pointer.hpp>
#include <boost/detail/workaround.hpp>
namespace boost{
namespace detail{
template <typename T, bool small_>
struct ct_imp2
{
typedef const T& param_type;
};
template <typename T>
struct ct_imp2<T, true>
{
typedef const T param_type;
};
template <typename T, bool isp, bool b1, bool b2>
struct ct_imp
{
typedef const T& param_type;
};
template <typename T, bool isp, bool b2>
struct ct_imp<T, isp, true, b2>
{
typedef typename ct_imp2<T, sizeof(T) <= sizeof(void*)>::param_type param_type;
};
template <typename T, bool isp, bool b1>
struct ct_imp<T, isp, b1, true>
{
typedef typename ct_imp2<T, sizeof(T) <= sizeof(void*)>::param_type param_type;
};
template <typename T, bool b1, bool b2>
struct ct_imp<T, true, b1, b2>
{
typedef const T param_type;
};
}
template <typename T>
struct call_traits
{
public:
typedef T value_type;
typedef T& reference;
typedef const T& const_reference;
//
// C++ Builder workaround: we should be able to define a compile time
// constant and pass that as a single template parameter to ct_imp<T,bool>,
// however compiler bugs prevent this - instead pass three bool's to
// ct_imp<T,bool,bool,bool> and add an extra partial specialisation
// of ct_imp to handle the logic. (JM)
typedef typename boost::detail::ct_imp<
T,
::boost::is_pointer<T>::value,
::boost::is_arithmetic<T>::value,
::boost::is_enum<T>::value
>::param_type param_type;
};
template <typename T>
struct call_traits<T&>
{
typedef T& value_type;
typedef T& reference;
typedef const T& const_reference;
typedef T& param_type; // hh removed const
};
#if BOOST_WORKAROUND( __BORLANDC__, < 0x5A0 )
// these are illegal specialisations; cv-qualifies applied to
// references have no effect according to [8.3.2p1],
// C++ Builder requires them though as it treats cv-qualified
// references as distinct types...
template <typename T>
struct call_traits<T&const>
{
typedef T& value_type;
typedef T& reference;
typedef const T& const_reference;
typedef T& param_type; // hh removed const
};
template <typename T>
struct call_traits<T&volatile>
{
typedef T& value_type;
typedef T& reference;
typedef const T& const_reference;
typedef T& param_type; // hh removed const
};
template <typename T>
struct call_traits<T&const volatile>
{
typedef T& value_type;
typedef T& reference;
typedef const T& const_reference;
typedef T& param_type; // hh removed const
};
template <typename T>
struct call_traits< T * >
{
typedef T * value_type;
typedef T * & reference;
typedef T * const & const_reference;
typedef T * const param_type; // hh removed const
};
#endif
#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
template <typename T, std::size_t N>
struct call_traits<T [N]>
{
private:
typedef T array_type[N];
public:
// degrades array to pointer:
typedef const T* value_type;
typedef array_type& reference;
typedef const array_type& const_reference;
typedef const T* const param_type;
};
template <typename T, std::size_t N>
struct call_traits<const T [N]>
{
private:
typedef const T array_type[N];
public:
// degrades array to pointer:
typedef const T* value_type;
typedef array_type& reference;
typedef const array_type& const_reference;
typedef const T* const param_type;
};
#endif
}
#endif // BOOST_DETAIL_CALL_TRAITS_HPP
@@ -0,0 +1,142 @@
// boost/catch_exceptions.hpp -----------------------------------------------//
// Copyright Beman Dawes 1995-2001. 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)
// See http://www.boost.org/libs/test for documentation.
// Revision History
// 13 Jun 01 report_exception() made inline. (John Maddock, Jesse Jones)
// 26 Feb 01 Numerous changes suggested during formal review. (Beman)
// 25 Jan 01 catch_exceptions.hpp code factored out of cpp_main.cpp.
// 22 Jan 01 Remove test_tools dependencies to reduce coupling.
// 5 Nov 00 Initial boost version (Beman Dawes)
#ifndef BOOST_CATCH_EXCEPTIONS_HPP
#define BOOST_CATCH_EXCEPTIONS_HPP
// header dependencies are deliberately restricted to the standard library
// to reduce coupling to other boost libraries.
#include <string> // for string
#include <new> // for bad_alloc
#include <typeinfo> // for bad_cast, bad_typeid
#include <exception> // for exception, bad_exception
#include <stdexcept> // for std exception hierarchy
#include <boost/cstdlib.hpp> // for exit codes
#include <ostream> // for ostream
# if defined(__BORLANDC__) && (__BORLANDC__ <= 0x0551)
# define BOOST_BUILT_IN_EXCEPTIONS_MISSING_WHAT
# endif
#if defined(MPW_CPLUS) && (MPW_CPLUS <= 0x890)
# define BOOST_BUILT_IN_EXCEPTIONS_MISSING_WHAT
namespace std { class bad_typeid { }; }
# endif
namespace boost
{
namespace detail
{
// A separate reporting function was requested during formal review.
inline void report_exception( std::ostream & os,
const char * name, const char * info )
{ os << "\n** uncaught exception: " << name << " " << info << std::endl; }
}
// catch_exceptions ------------------------------------------------------//
template< class Generator > // Generator is function object returning int
int catch_exceptions( Generator function_object,
std::ostream & out, std::ostream & err )
{
int result = 0; // quiet compiler warnings
bool exception_thrown = true; // avoid setting result for each excptn type
#ifndef BOOST_NO_EXCEPTIONS
try
{
#endif
result = function_object();
exception_thrown = false;
#ifndef BOOST_NO_EXCEPTIONS
}
// As a result of hard experience with strangely interleaved output
// under some compilers, there is a lot of use of endl in the code below
// where a simple '\n' might appear to do.
// The rules for catch & arguments are a bit different from function
// arguments (ISO 15.3 paragraphs 18 & 19). Apparently const isn't
// required, but it doesn't hurt and some programmers ask for it.
catch ( const char * ex )
{ detail::report_exception( out, "", ex ); }
catch ( const std::string & ex )
{ detail::report_exception( out, "", ex.c_str() ); }
// std:: exceptions
catch ( const std::bad_alloc & ex )
{ detail::report_exception( out, "std::bad_alloc:", ex.what() ); }
# ifndef BOOST_BUILT_IN_EXCEPTIONS_MISSING_WHAT
catch ( const std::bad_cast & ex )
{ detail::report_exception( out, "std::bad_cast:", ex.what() ); }
catch ( const std::bad_typeid & ex )
{ detail::report_exception( out, "std::bad_typeid:", ex.what() ); }
# else
catch ( const std::bad_cast & )
{ detail::report_exception( out, "std::bad_cast", "" ); }
catch ( const std::bad_typeid & )
{ detail::report_exception( out, "std::bad_typeid", "" ); }
# endif
catch ( const std::bad_exception & ex )
{ detail::report_exception( out, "std::bad_exception:", ex.what() ); }
catch ( const std::domain_error & ex )
{ detail::report_exception( out, "std::domain_error:", ex.what() ); }
catch ( const std::invalid_argument & ex )
{ detail::report_exception( out, "std::invalid_argument:", ex.what() ); }
catch ( const std::length_error & ex )
{ detail::report_exception( out, "std::length_error:", ex.what() ); }
catch ( const std::out_of_range & ex )
{ detail::report_exception( out, "std::out_of_range:", ex.what() ); }
catch ( const std::range_error & ex )
{ detail::report_exception( out, "std::range_error:", ex.what() ); }
catch ( const std::overflow_error & ex )
{ detail::report_exception( out, "std::overflow_error:", ex.what() ); }
catch ( const std::underflow_error & ex )
{ detail::report_exception( out, "std::underflow_error:", ex.what() ); }
catch ( const std::logic_error & ex )
{ detail::report_exception( out, "std::logic_error:", ex.what() ); }
catch ( const std::runtime_error & ex )
{ detail::report_exception( out, "std::runtime_error:", ex.what() ); }
catch ( const std::exception & ex )
{ detail::report_exception( out, "std::exception:", ex.what() ); }
catch ( ... )
{ detail::report_exception( out, "unknown exception", "" ); }
#endif // BOOST_NO_EXCEPTIONS
if ( exception_thrown ) result = boost::exit_exception_failure;
if ( result != 0 && result != exit_success )
{
out << std::endl << "**** returning with error code "
<< result << std::endl;
err
<< "********** errors detected; see stdout for details ***********"
<< std::endl;
}
#if !defined(BOOST_NO_CPP_MAIN_SUCCESS_MESSAGE)
else { out << std::flush << "no errors detected" << std::endl; }
#endif
return result;
} // catch_exceptions
} // boost
#endif // BOOST_CATCH_EXCEPTIONS_HPP
@@ -0,0 +1,443 @@
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
// Use, modification and distribution are subject to 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).
//
// See http://www.boost.org/libs/utility for most recent version including documentation.
// compressed_pair: pair that "compresses" empty members
// (see libs/utility/doc/html/compressed_pair.html)
//
// JM changes 25 Jan 2004:
// For the case where T1 == T2 and both are empty, then first() and second()
// should return different objects.
// JM changes 25 Jan 2000:
// Removed default arguments from compressed_pair_switch to get
// C++ Builder 4 to accept them
// rewriten swap to get gcc and C++ builder to compile.
// added partial specialisations for case T1 == T2 to avoid duplicate constructor defs.
#ifndef BOOST_DETAIL_COMPRESSED_PAIR_HPP
#define BOOST_DETAIL_COMPRESSED_PAIR_HPP
#include <algorithm>
#include <boost/type_traits/remove_cv.hpp>
#include <boost/type_traits/is_empty.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/call_traits.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable:4512)
#endif
namespace boost
{
template <class T1, class T2>
class compressed_pair;
// compressed_pair
namespace details
{
// JM altered 26 Jan 2000:
template <class T1, class T2, bool IsSame, bool FirstEmpty, bool SecondEmpty>
struct compressed_pair_switch;
template <class T1, class T2>
struct compressed_pair_switch<T1, T2, false, false, false>
{static const int value = 0;};
template <class T1, class T2>
struct compressed_pair_switch<T1, T2, false, true, true>
{static const int value = 3;};
template <class T1, class T2>
struct compressed_pair_switch<T1, T2, false, true, false>
{static const int value = 1;};
template <class T1, class T2>
struct compressed_pair_switch<T1, T2, false, false, true>
{static const int value = 2;};
template <class T1, class T2>
struct compressed_pair_switch<T1, T2, true, true, true>
{static const int value = 4;};
template <class T1, class T2>
struct compressed_pair_switch<T1, T2, true, false, false>
{static const int value = 5;};
template <class T1, class T2, int Version> class compressed_pair_imp;
#ifdef __GNUC__
// workaround for GCC (JM):
using std::swap;
#endif
//
// can't call unqualified swap from within classname::swap
// as Koenig lookup rules will find only the classname::swap
// member function not the global declaration, so use cp_swap
// as a forwarding function (JM):
template <typename T>
inline void cp_swap(T& t1, T& t2)
{
#ifndef __GNUC__
using std::swap;
#endif
swap(t1, t2);
}
// 0 derive from neither
template <class T1, class T2>
class compressed_pair_imp<T1, T2, 0>
{
public:
typedef T1 first_type;
typedef T2 second_type;
typedef typename call_traits<first_type>::param_type first_param_type;
typedef typename call_traits<second_type>::param_type second_param_type;
typedef typename call_traits<first_type>::reference first_reference;
typedef typename call_traits<second_type>::reference second_reference;
typedef typename call_traits<first_type>::const_reference first_const_reference;
typedef typename call_traits<second_type>::const_reference second_const_reference;
compressed_pair_imp() {}
compressed_pair_imp(first_param_type x, second_param_type y)
: first_(x), second_(y) {}
compressed_pair_imp(first_param_type x)
: first_(x) {}
compressed_pair_imp(second_param_type y)
: second_(y) {}
first_reference first() {return first_;}
first_const_reference first() const {return first_;}
second_reference second() {return second_;}
second_const_reference second() const {return second_;}
void swap(::boost::compressed_pair<T1, T2>& y)
{
cp_swap(first_, y.first());
cp_swap(second_, y.second());
}
private:
first_type first_;
second_type second_;
};
// 1 derive from T1
template <class T1, class T2>
class compressed_pair_imp<T1, T2, 1>
: protected ::boost::remove_cv<T1>::type
{
public:
typedef T1 first_type;
typedef T2 second_type;
typedef typename call_traits<first_type>::param_type first_param_type;
typedef typename call_traits<second_type>::param_type second_param_type;
typedef typename call_traits<first_type>::reference first_reference;
typedef typename call_traits<second_type>::reference second_reference;
typedef typename call_traits<first_type>::const_reference first_const_reference;
typedef typename call_traits<second_type>::const_reference second_const_reference;
compressed_pair_imp() {}
compressed_pair_imp(first_param_type x, second_param_type y)
: first_type(x), second_(y) {}
compressed_pair_imp(first_param_type x)
: first_type(x) {}
compressed_pair_imp(second_param_type y)
: second_(y) {}
first_reference first() {return *this;}
first_const_reference first() const {return *this;}
second_reference second() {return second_;}
second_const_reference second() const {return second_;}
void swap(::boost::compressed_pair<T1,T2>& y)
{
// no need to swap empty base class:
cp_swap(second_, y.second());
}
private:
second_type second_;
};
// 2 derive from T2
template <class T1, class T2>
class compressed_pair_imp<T1, T2, 2>
: protected ::boost::remove_cv<T2>::type
{
public:
typedef T1 first_type;
typedef T2 second_type;
typedef typename call_traits<first_type>::param_type first_param_type;
typedef typename call_traits<second_type>::param_type second_param_type;
typedef typename call_traits<first_type>::reference first_reference;
typedef typename call_traits<second_type>::reference second_reference;
typedef typename call_traits<first_type>::const_reference first_const_reference;
typedef typename call_traits<second_type>::const_reference second_const_reference;
compressed_pair_imp() {}
compressed_pair_imp(first_param_type x, second_param_type y)
: second_type(y), first_(x) {}
compressed_pair_imp(first_param_type x)
: first_(x) {}
compressed_pair_imp(second_param_type y)
: second_type(y) {}
first_reference first() {return first_;}
first_const_reference first() const {return first_;}
second_reference second() {return *this;}
second_const_reference second() const {return *this;}
void swap(::boost::compressed_pair<T1,T2>& y)
{
// no need to swap empty base class:
cp_swap(first_, y.first());
}
private:
first_type first_;
};
// 3 derive from T1 and T2
template <class T1, class T2>
class compressed_pair_imp<T1, T2, 3>
: protected ::boost::remove_cv<T1>::type,
protected ::boost::remove_cv<T2>::type
{
public:
typedef T1 first_type;
typedef T2 second_type;
typedef typename call_traits<first_type>::param_type first_param_type;
typedef typename call_traits<second_type>::param_type second_param_type;
typedef typename call_traits<first_type>::reference first_reference;
typedef typename call_traits<second_type>::reference second_reference;
typedef typename call_traits<first_type>::const_reference first_const_reference;
typedef typename call_traits<second_type>::const_reference second_const_reference;
compressed_pair_imp() {}
compressed_pair_imp(first_param_type x, second_param_type y)
: first_type(x), second_type(y) {}
compressed_pair_imp(first_param_type x)
: first_type(x) {}
compressed_pair_imp(second_param_type y)
: second_type(y) {}
first_reference first() {return *this;}
first_const_reference first() const {return *this;}
second_reference second() {return *this;}
second_const_reference second() const {return *this;}
//
// no need to swap empty bases:
void swap(::boost::compressed_pair<T1,T2>&) {}
};
// JM
// 4 T1 == T2, T1 and T2 both empty
// Originally this did not store an instance of T2 at all
// but that led to problems beause it meant &x.first() == &x.second()
// which is not true for any other kind of pair, so now we store an instance
// of T2 just in case the user is relying on first() and second() returning
// different objects (albeit both empty).
template <class T1, class T2>
class compressed_pair_imp<T1, T2, 4>
: protected ::boost::remove_cv<T1>::type
{
public:
typedef T1 first_type;
typedef T2 second_type;
typedef typename call_traits<first_type>::param_type first_param_type;
typedef typename call_traits<second_type>::param_type second_param_type;
typedef typename call_traits<first_type>::reference first_reference;
typedef typename call_traits<second_type>::reference second_reference;
typedef typename call_traits<first_type>::const_reference first_const_reference;
typedef typename call_traits<second_type>::const_reference second_const_reference;
compressed_pair_imp() {}
compressed_pair_imp(first_param_type x, second_param_type y)
: first_type(x), m_second(y) {}
compressed_pair_imp(first_param_type x)
: first_type(x), m_second(x) {}
first_reference first() {return *this;}
first_const_reference first() const {return *this;}
second_reference second() {return m_second;}
second_const_reference second() const {return m_second;}
void swap(::boost::compressed_pair<T1,T2>&) {}
private:
T2 m_second;
};
// 5 T1 == T2 and are not empty: //JM
template <class T1, class T2>
class compressed_pair_imp<T1, T2, 5>
{
public:
typedef T1 first_type;
typedef T2 second_type;
typedef typename call_traits<first_type>::param_type first_param_type;
typedef typename call_traits<second_type>::param_type second_param_type;
typedef typename call_traits<first_type>::reference first_reference;
typedef typename call_traits<second_type>::reference second_reference;
typedef typename call_traits<first_type>::const_reference first_const_reference;
typedef typename call_traits<second_type>::const_reference second_const_reference;
compressed_pair_imp() {}
compressed_pair_imp(first_param_type x, second_param_type y)
: first_(x), second_(y) {}
compressed_pair_imp(first_param_type x)
: first_(x), second_(x) {}
first_reference first() {return first_;}
first_const_reference first() const {return first_;}
second_reference second() {return second_;}
second_const_reference second() const {return second_;}
void swap(::boost::compressed_pair<T1, T2>& y)
{
cp_swap(first_, y.first());
cp_swap(second_, y.second());
}
private:
first_type first_;
second_type second_;
};
} // details
template <class T1, class T2>
class compressed_pair
: private ::boost::details::compressed_pair_imp<T1, T2,
::boost::details::compressed_pair_switch<
T1,
T2,
::boost::is_same<typename remove_cv<T1>::type, typename remove_cv<T2>::type>::value,
::boost::is_empty<T1>::value,
::boost::is_empty<T2>::value>::value>
{
private:
typedef details::compressed_pair_imp<T1, T2,
::boost::details::compressed_pair_switch<
T1,
T2,
::boost::is_same<typename remove_cv<T1>::type, typename remove_cv<T2>::type>::value,
::boost::is_empty<T1>::value,
::boost::is_empty<T2>::value>::value> base;
public:
typedef T1 first_type;
typedef T2 second_type;
typedef typename call_traits<first_type>::param_type first_param_type;
typedef typename call_traits<second_type>::param_type second_param_type;
typedef typename call_traits<first_type>::reference first_reference;
typedef typename call_traits<second_type>::reference second_reference;
typedef typename call_traits<first_type>::const_reference first_const_reference;
typedef typename call_traits<second_type>::const_reference second_const_reference;
compressed_pair() : base() {}
compressed_pair(first_param_type x, second_param_type y) : base(x, y) {}
explicit compressed_pair(first_param_type x) : base(x) {}
explicit compressed_pair(second_param_type y) : base(y) {}
first_reference first() {return base::first();}
first_const_reference first() const {return base::first();}
second_reference second() {return base::second();}
second_const_reference second() const {return base::second();}
void swap(compressed_pair& y) { base::swap(y); }
};
// JM
// Partial specialisation for case where T1 == T2:
//
template <class T>
class compressed_pair<T, T>
: private details::compressed_pair_imp<T, T,
::boost::details::compressed_pair_switch<
T,
T,
::boost::is_same<typename remove_cv<T>::type, typename remove_cv<T>::type>::value,
::boost::is_empty<T>::value,
::boost::is_empty<T>::value>::value>
{
private:
typedef details::compressed_pair_imp<T, T,
::boost::details::compressed_pair_switch<
T,
T,
::boost::is_same<typename remove_cv<T>::type, typename remove_cv<T>::type>::value,
::boost::is_empty<T>::value,
::boost::is_empty<T>::value>::value> base;
public:
typedef T first_type;
typedef T second_type;
typedef typename call_traits<first_type>::param_type first_param_type;
typedef typename call_traits<second_type>::param_type second_param_type;
typedef typename call_traits<first_type>::reference first_reference;
typedef typename call_traits<second_type>::reference second_reference;
typedef typename call_traits<first_type>::const_reference first_const_reference;
typedef typename call_traits<second_type>::const_reference second_const_reference;
compressed_pair() : base() {}
compressed_pair(first_param_type x, second_param_type y) : base(x, y) {}
#if !(defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530))
explicit
#endif
compressed_pair(first_param_type x) : base(x) {}
first_reference first() {return base::first();}
first_const_reference first() const {return base::first();}
second_reference second() {return base::second();}
second_const_reference second() const {return base::second();}
void swap(::boost::compressed_pair<T,T>& y) { base::swap(y); }
};
template <class T1, class T2>
inline
void
swap(compressed_pair<T1, T2>& x, compressed_pair<T1, T2>& y)
{
x.swap(y);
}
} // boost
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
#endif // BOOST_DETAIL_COMPRESSED_PAIR_HPP
@@ -0,0 +1,157 @@
// Copyright 2005-2011 Daniel James.
// 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)
// Note: if you change this include guard, you also need to change
// container_fwd_compile_fail.cpp
#if !defined(BOOST_DETAIL_CONTAINER_FWD_HPP)
#define BOOST_DETAIL_CONTAINER_FWD_HPP
#if defined(_MSC_VER) && \
!defined(BOOST_DETAIL_TEST_CONFIG_ONLY)
# pragma once
#endif
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
////////////////////////////////////////////////////////////////////////////////
// //
// Define BOOST_DETAIL_NO_CONTAINER_FWD if you don't want this header to //
// forward declare standard containers. //
// //
// BOOST_DETAIL_CONTAINER_FWD to make it foward declare containers even if it //
// normally doesn't. //
// //
// BOOST_DETAIL_NO_CONTAINER_FWD overrides BOOST_DETAIL_CONTAINER_FWD. //
// //
////////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_DETAIL_NO_CONTAINER_FWD)
# if defined(BOOST_DETAIL_CONTAINER_FWD)
// Force forward declarations.
# elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
// STLport
# define BOOST_DETAIL_NO_CONTAINER_FWD
# elif defined(__LIBCOMO__)
// Comeau STL:
# define BOOST_DETAIL_NO_CONTAINER_FWD
# elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)
// Rogue Wave library:
# define BOOST_DETAIL_NO_CONTAINER_FWD
# elif defined(_LIBCPP_VERSION)
// libc++
# define BOOST_DETAIL_NO_CONTAINER_FWD
# elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
// GNU libstdc++ 3
//
// Disable forwarding for all recent versions, as the library has a
// versioned namespace mode, and I don't know how to detect it.
# if __GLIBCXX__ >= 20070513 \
|| defined(_GLIBCXX_DEBUG) \
|| defined(_GLIBCXX_PARALLEL) \
|| defined(_GLIBCXX_PROFILE)
# define BOOST_DETAIL_NO_CONTAINER_FWD
# else
# if defined(__GLIBCXX__) && __GLIBCXX__ >= 20040530
# define BOOST_CONTAINER_FWD_COMPLEX_STRUCT
# endif
# endif
# elif defined(__STL_CONFIG_H)
// generic SGI STL
//
// Forward declaration seems to be okay, but it has a couple of odd
// implementations.
# define BOOST_CONTAINER_FWD_BAD_BITSET
# if !defined(__STL_NON_TYPE_TMPL_PARAM_BUG)
# define BOOST_CONTAINER_FWD_BAD_DEQUE
# endif
# elif defined(__MSL_CPP__)
// MSL standard lib:
# define BOOST_DETAIL_NO_CONTAINER_FWD
# elif defined(__IBMCPP__)
// The default VACPP std lib, forward declaration seems to be fine.
# elif defined(MSIPL_COMPILE_H)
// Modena C++ standard library
# define BOOST_DETAIL_NO_CONTAINER_FWD
# elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
// Dinkumware Library (this has to appear after any possible replacement
// libraries)
# else
# define BOOST_DETAIL_NO_CONTAINER_FWD
# endif
#endif
#if !defined(BOOST_DETAIL_TEST_CONFIG_ONLY)
#if defined(BOOST_DETAIL_NO_CONTAINER_FWD) && \
!defined(BOOST_DETAIL_TEST_FORCE_CONTAINER_FWD)
#include <deque>
#include <list>
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <complex>
#else
#include <cstddef>
#if defined(BOOST_CONTAINER_FWD_BAD_DEQUE)
#include <deque>
#endif
#if defined(BOOST_CONTAINER_FWD_BAD_BITSET)
#include <bitset>
#endif
#if defined(BOOST_MSVC)
#pragma warning(push)
#pragma warning(disable:4099) // struct/class mismatch in fwd declarations
#endif
namespace std
{
template <class T> class allocator;
template <class charT, class traits, class Allocator> class basic_string;
template <class charT> struct char_traits;
#if defined(BOOST_CONTAINER_FWD_COMPLEX_STRUCT)
template <class T> struct complex;
#else
template <class T> class complex;
#endif
#if !defined(BOOST_CONTAINER_FWD_BAD_DEQUE)
template <class T, class Allocator> class deque;
#endif
template <class T, class Allocator> class list;
template <class T, class Allocator> class vector;
template <class Key, class T, class Compare, class Allocator> class map;
template <class Key, class T, class Compare, class Allocator>
class multimap;
template <class Key, class Compare, class Allocator> class set;
template <class Key, class Compare, class Allocator> class multiset;
#if !defined(BOOST_CONTAINER_FWD_BAD_BITSET)
template <size_t N> class bitset;
#endif
template <class T1, class T2> struct pair;
}
#if defined(BOOST_MSVC)
#pragma warning(pop)
#endif
#endif // BOOST_DETAIL_NO_CONTAINER_FWD &&
// !defined(BOOST_DETAIL_TEST_FORCE_CONTAINER_FWD)
#endif // BOOST_DETAIL_TEST_CONFIG_ONLY
#endif
@@ -0,0 +1,241 @@
// -----------------------------------------------------------
//
// Copyright (c) 2001-2002 Chuck Allison and Jeremy Siek
// Copyright (c) 2003-2006, 2008 Gennaro Prota
//
// Copyright (c) 2014 Glen Joseph Fernandes
// glenfe at live dot com
//
// 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)
//
// -----------------------------------------------------------
#ifndef BOOST_DETAIL_DYNAMIC_BITSET_HPP
#define BOOST_DETAIL_DYNAMIC_BITSET_HPP
#include <memory>
#include <cstddef>
#include "boost/config.hpp"
#include "boost/detail/workaround.hpp"
namespace boost {
namespace detail {
namespace dynamic_bitset_impl {
// Gives (read-)access to the object representation
// of an object of type T (3.9p4). CANNOT be used
// on a base sub-object
//
template <typename T>
inline const unsigned char * object_representation (T* p)
{
return static_cast<const unsigned char *>(static_cast<const void *>(p));
}
template<typename T, int amount, int width /* = default */>
struct shifter
{
static void left_shift(T & v) {
amount >= width ? (v = 0)
: (v >>= BOOST_DYNAMIC_BITSET_WRAP_CONSTANT(amount));
}
};
// ------- count function implementation --------------
typedef unsigned char byte_type;
// These two entities
//
// enum mode { access_by_bytes, access_by_blocks };
// template <mode> struct mode_to_type {};
//
// were removed, since the regression logs (as of 24 Aug 2008)
// showed that several compilers had troubles with recognizing
//
// const mode m = access_by_bytes
//
// as a constant expression
//
// * So, we'll use bool, instead of enum *.
//
template <bool value>
struct value_to_type
{
value_to_type() {}
};
const bool access_by_bytes = true;
const bool access_by_blocks = false;
// the table: wrapped in a class template, so
// that it is only instantiated if/when needed
//
template <bool dummy_name = true>
struct count_table { static const byte_type table[]; };
template <>
struct count_table<false> { /* no table */ };
const unsigned int table_width = 8;
template <bool b>
const byte_type count_table<b>::table[] =
{
// Automatically generated by GPTableGen.exe v.1.0
//
0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8
};
// overload for access by bytes
//
template <typename Iterator>
inline std::size_t do_count(Iterator first, std::size_t length,
int /*dummy param*/,
value_to_type<access_by_bytes>* )
{
std::size_t num = 0;
if (length)
{
const byte_type * p = object_representation(&*first);
length *= sizeof(*first);
do {
num += count_table<>::table[*p];
++p;
--length;
} while (length);
}
return num;
}
// overload for access by blocks
//
template <typename Iterator, typename ValueType>
inline std::size_t do_count(Iterator first, std::size_t length, ValueType,
value_to_type<access_by_blocks>*)
{
std::size_t num = 0;
while (length){
ValueType value = *first;
while (value) {
num += count_table<>::table[value & ((1u<<table_width) - 1)];
value >>= table_width;
}
++first;
--length;
}
return num;
}
// -------------------------------------------------------
// Some library implementations simply return a dummy
// value such as
//
// size_type(-1) / sizeof(T)
//
// from vector<>::max_size. This tries to get more
// meaningful info.
//
template <typename T>
inline typename T::size_type vector_max_size_workaround(const T & v)
BOOST_NOEXCEPT
{
typedef typename T::allocator_type allocator_type;
const allocator_type& alloc = v.get_allocator();
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
typedef std::allocator_traits<allocator_type> allocator_traits;
const typename allocator_traits::size_type alloc_max =
allocator_traits::max_size(alloc);
#else
const typename allocator_type::size_type alloc_max = alloc.max_size();
#endif
const typename T::size_type container_max = v.max_size();
return alloc_max < container_max ? alloc_max : container_max;
}
// for static_asserts
template <typename T>
struct allowed_block_type {
enum { value = T(-1) > 0 }; // ensure T has no sign
};
template <>
struct allowed_block_type<bool> {
enum { value = false };
};
template <typename T>
struct is_numeric {
enum { value = false };
};
# define BOOST_dynamic_bitset_is_numeric(x) \
template<> \
struct is_numeric< x > { \
enum { value = true }; \
} /**/
BOOST_dynamic_bitset_is_numeric(bool);
BOOST_dynamic_bitset_is_numeric(char);
#if !defined(BOOST_NO_INTRINSIC_WCHAR_T)
BOOST_dynamic_bitset_is_numeric(wchar_t);
#endif
BOOST_dynamic_bitset_is_numeric(signed char);
BOOST_dynamic_bitset_is_numeric(short int);
BOOST_dynamic_bitset_is_numeric(int);
BOOST_dynamic_bitset_is_numeric(long int);
BOOST_dynamic_bitset_is_numeric(unsigned char);
BOOST_dynamic_bitset_is_numeric(unsigned short);
BOOST_dynamic_bitset_is_numeric(unsigned int);
BOOST_dynamic_bitset_is_numeric(unsigned long);
#if defined(BOOST_HAS_LONG_LONG)
BOOST_dynamic_bitset_is_numeric(::boost::long_long_type);
BOOST_dynamic_bitset_is_numeric(::boost::ulong_long_type);
#endif
// intentionally omitted
//BOOST_dynamic_bitset_is_numeric(float);
//BOOST_dynamic_bitset_is_numeric(double);
//BOOST_dynamic_bitset_is_numeric(long double);
#undef BOOST_dynamic_bitset_is_numeric
} // dynamic_bitset_impl
} // namespace detail
} // namespace boost
#endif // include guard
@@ -0,0 +1,11 @@
// Copyright 2013 Rene Rivera
// Distributed under the Boost Software License, Version 1.0. (See accompany-
// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_DETAIL_ENDIAN_HPP
#define BOOST_DETAIL_ENDIAN_HPP
// Use the Predef library for the detection of endianess.
#include <boost/predef/detail/endian_compat.h>
#endif
@@ -0,0 +1,101 @@
/*=============================================================================
Copyright (c) 2010 Bryce Lelbach
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>
#if defined(BOOST_NO_FENV_H)
#error This platform does not have a floating point environment
#endif
#if !defined(BOOST_DETAIL_FENV_HPP)
#define BOOST_DETAIL_FENV_HPP
/* If we're using clang + glibc, we have to get hacky.
* See http://llvm.org/bugs/show_bug.cgi?id=6907 */
#if defined(__clang__) && (__clang_major__ < 3) && \
defined(__GNU_LIBRARY__) && /* up to version 5 */ \
defined(__GLIBC__) && /* version 6 + */ \
!defined(_FENV_H)
#define _FENV_H
#include <features.h>
#include <bits/fenv.h>
extern "C" {
extern int fegetexceptflag (fexcept_t*, int) __THROW;
extern int fesetexceptflag (__const fexcept_t*, int) __THROW;
extern int feclearexcept (int) __THROW;
extern int feraiseexcept (int) __THROW;
extern int fetestexcept (int) __THROW;
extern int fegetround (void) __THROW;
extern int fesetround (int) __THROW;
extern int fegetenv (fenv_t*) __THROW;
extern int fesetenv (__const fenv_t*) __THROW;
extern int feupdateenv (__const fenv_t*) __THROW;
extern int feholdexcept (fenv_t*) __THROW;
#ifdef __USE_GNU
extern int feenableexcept (int) __THROW;
extern int fedisableexcept (int) __THROW;
extern int fegetexcept (void) __THROW;
#endif
}
namespace std { namespace tr1 {
using ::fenv_t;
using ::fexcept_t;
using ::fegetexceptflag;
using ::fesetexceptflag;
using ::feclearexcept;
using ::feraiseexcept;
using ::fetestexcept;
using ::fegetround;
using ::fesetround;
using ::fegetenv;
using ::fesetenv;
using ::feupdateenv;
using ::feholdexcept;
} }
#elif defined(__MINGW32__) && defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 408
// MinGW (32-bit) has a bug in mingw32/bits/c++config.h, it does not define _GLIBCXX_HAVE_FENV_H,
// which prevents the C fenv.h header contents to be included in the C++ wrapper header fenv.h. This is at least
// the case with gcc 4.8.1 packages tested so far, up to 4.8.1-4. Note that there is no issue with
// MinGW-w64.
// To work around the bug we avoid including the C++ wrapper header and include the C header directly
// and import all relevant symbols into std:: ourselves.
#include <../include/fenv.h>
namespace std {
using ::fenv_t;
using ::fexcept_t;
using ::fegetexceptflag;
using ::fesetexceptflag;
using ::feclearexcept;
using ::feraiseexcept;
using ::fetestexcept;
using ::fegetround;
using ::fesetround;
using ::fegetenv;
using ::fesetenv;
using ::feupdateenv;
using ::feholdexcept;
}
#else /* if we're not using GNU's C stdlib, fenv.h should work with clang */
#if defined(__SUNPRO_CC) /* lol suncc */
#include <stdio.h>
#endif
#include <fenv.h>
#endif
#endif /* BOOST_DETAIL_FENV_HPP */
@@ -0,0 +1,29 @@
// (C) Copyright Matthias Troyerk 2006.
// Use, modification and distribution are subject to 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).
//
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_DETAIL_HAS_DEFAULT_CONSTRUCTOR_HPP_INCLUDED
#define BOOST_DETAIL_HAS_DEFAULT_CONSTRUCTOR_HPP_INCLUDED
#include <boost/type_traits/has_trivial_constructor.hpp>
namespace boost { namespace detail {
/// type trait to check for a default constructor
///
/// The default implementation just checks for a trivial constructor.
/// Using some compiler magic it might be possible to provide a better default
template <class T>
struct has_default_constructor
: public has_trivial_constructor<T>
{};
} } // namespace boost::detail
#endif // BOOST_DETAIL_HAS_DEFAULT_CONSTRUCTOR_HPP_INCLUDED
@@ -0,0 +1,87 @@
// boost/identifier.hpp ----------------------------------------------------//
// Copyright Beman Dawes 2006
// 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)
// See documentation at http://www.boost.org/libs/utility
#ifndef BOOST_IDENTIFIER_HPP
#define BOOST_IDENTIFIER_HPP
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_base_of.hpp>
#include <iosfwd>
namespace boost
{
namespace detail
{
// class template identifier ---------------------------------------------//
// Always used as a base class so that different instantiations result in
// different class types even if instantiated with the same value type T.
// Expected usage is that T is often an integer type, best passed by
// value. There is no reason why T can't be a possibly larger class such as
// std::string, best passed by const reference.
// This implementation uses pass by value, based on expected common uses.
template <typename T, typename D>
class identifier
{
public:
typedef T value_type;
const value_type value() const { return m_value; }
void assign( value_type v ) { m_value = v; }
bool operator==( const D & rhs ) const { return m_value == rhs.m_value; }
bool operator!=( const D & rhs ) const { return m_value != rhs.m_value; }
bool operator< ( const D & rhs ) const { return m_value < rhs.m_value; }
bool operator<=( const D & rhs ) const { return m_value <= rhs.m_value; }
bool operator> ( const D & rhs ) const { return m_value > rhs.m_value; }
bool operator>=( const D & rhs ) const { return m_value >= rhs.m_value; }
typedef void (*unspecified_bool_type)(D); // without the D, unspecified_bool_type
static void unspecified_bool_true(D){} // conversion allows relational operators
// between different identifier types
operator unspecified_bool_type() const { return m_value == value_type() ? 0 : unspecified_bool_true; }
bool operator!() const { return m_value == value_type(); }
// constructors are protected so that class can only be used as a base class
protected:
identifier() {}
explicit identifier( value_type v ) : m_value(v) {}
private:
T m_value;
};
//#ifndef BOOST_NO_SFINAE
// template <class Ostream, class Id>
// typename enable_if< is_base_of< identifier< typename Id::value_type, Id >, Id >,
// Ostream & >::type operator<<( Ostream & os, const Id & id )
// {
// return os << id.value();
// }
// template <class Istream, class Id>
// typename enable_if< is_base_of< identifier< typename Id::value_type, Id >, Id >,
// Istream & >::type operator>>( Istream & is, Id & id )
// {
// typename Id::value_type v;
// is >> v;
// id.value( v );
// return is;
// }
//#endif
} // namespace detail
} // namespace boost
#endif // BOOST_IDENTIFIER_HPP
@@ -0,0 +1,204 @@
// Copyright David Abrahams 2002.
// 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)
#ifndef INDIRECT_TRAITS_DWA2002131_HPP
# define INDIRECT_TRAITS_DWA2002131_HPP
# include <boost/type_traits/is_function.hpp>
# include <boost/type_traits/is_reference.hpp>
# include <boost/type_traits/is_pointer.hpp>
# include <boost/type_traits/is_class.hpp>
# include <boost/type_traits/is_const.hpp>
# include <boost/type_traits/is_volatile.hpp>
# include <boost/type_traits/is_member_function_pointer.hpp>
# include <boost/type_traits/is_member_pointer.hpp>
# include <boost/type_traits/remove_cv.hpp>
# include <boost/type_traits/remove_reference.hpp>
# include <boost/type_traits/remove_pointer.hpp>
# include <boost/detail/workaround.hpp>
# include <boost/mpl/eval_if.hpp>
# include <boost/mpl/if.hpp>
# include <boost/mpl/bool.hpp>
# include <boost/mpl/and.hpp>
# include <boost/mpl/not.hpp>
# include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace detail {
namespace indirect_traits {
template <class T>
struct is_reference_to_const : mpl::false_
{
};
template <class T>
struct is_reference_to_const<T const&> : mpl::true_
{
};
# if defined(BOOST_MSVC) && _MSC_FULL_VER <= 13102140 // vc7.01 alpha workaround
template<class T>
struct is_reference_to_const<T const volatile&> : mpl::true_
{
};
# endif
template <class T>
struct is_reference_to_function : mpl::false_
{
};
template <class T>
struct is_reference_to_function<T&> : is_function<T>
{
};
template <class T>
struct is_pointer_to_function : mpl::false_
{
};
// There's no such thing as a pointer-to-cv-function, so we don't need
// specializations for those
template <class T>
struct is_pointer_to_function<T*> : is_function<T>
{
};
template <class T>
struct is_reference_to_member_function_pointer_impl : mpl::false_
{
};
template <class T>
struct is_reference_to_member_function_pointer_impl<T&>
: is_member_function_pointer<typename remove_cv<T>::type>
{
};
template <class T>
struct is_reference_to_member_function_pointer
: is_reference_to_member_function_pointer_impl<T>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_member_function_pointer,(T))
};
template <class T>
struct is_reference_to_function_pointer_aux
: mpl::and_<
is_reference<T>
, is_pointer_to_function<
typename remove_cv<
typename remove_reference<T>::type
>::type
>
>
{
// There's no such thing as a pointer-to-cv-function, so we don't need specializations for those
};
template <class T>
struct is_reference_to_function_pointer
: mpl::if_<
is_reference_to_function<T>
, mpl::false_
, is_reference_to_function_pointer_aux<T>
>::type
{
};
template <class T>
struct is_reference_to_non_const
: mpl::and_<
is_reference<T>
, mpl::not_<
is_reference_to_const<T>
>
>
{
};
template <class T>
struct is_reference_to_volatile : mpl::false_
{
};
template <class T>
struct is_reference_to_volatile<T volatile&> : mpl::true_
{
};
# if defined(BOOST_MSVC) && _MSC_FULL_VER <= 13102140 // vc7.01 alpha workaround
template <class T>
struct is_reference_to_volatile<T const volatile&> : mpl::true_
{
};
# endif
template <class T>
struct is_reference_to_pointer : mpl::false_
{
};
template <class T>
struct is_reference_to_pointer<T*&> : mpl::true_
{
};
template <class T>
struct is_reference_to_pointer<T* const&> : mpl::true_
{
};
template <class T>
struct is_reference_to_pointer<T* volatile&> : mpl::true_
{
};
template <class T>
struct is_reference_to_pointer<T* const volatile&> : mpl::true_
{
};
template <class T>
struct is_reference_to_class
: mpl::and_<
is_reference<T>
, is_class<
typename remove_cv<
typename remove_reference<T>::type
>::type
>
>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_class,(T))
};
template <class T>
struct is_pointer_to_class
: mpl::and_<
is_pointer<T>
, is_class<
typename remove_cv<
typename remove_pointer<T>::type
>::type
>
>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_pointer_to_class,(T))
};
}
using namespace indirect_traits;
}} // namespace boost::python::detail
#endif // INDIRECT_TRAITS_DWA2002131_HPP
@@ -0,0 +1,218 @@
#ifndef BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED
#define BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED
//
// boost/detail/interlocked.hpp
//
// Copyright 2005 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>
// MS compatible compilers support #pragma once
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if defined( BOOST_USE_WINDOWS_H )
# include <windows.h>
# define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement
# define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange
# define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange
# define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER InterlockedCompareExchangePointer
# define BOOST_INTERLOCKED_EXCHANGE_POINTER InterlockedExchangePointer
#elif defined( BOOST_USE_INTRIN_H )
#include <intrin.h>
# define BOOST_INTERLOCKED_INCREMENT _InterlockedIncrement
# define BOOST_INTERLOCKED_DECREMENT _InterlockedDecrement
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange
# define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange
# define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd
# if defined(_M_IA64) || defined(_M_AMD64) || defined(__x86_64__) || defined(__x86_64)
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER _InterlockedCompareExchangePointer
# define BOOST_INTERLOCKED_EXCHANGE_POINTER _InterlockedExchangePointer
# else
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))
# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange)))
# endif
#elif defined(_WIN32_WCE)
#if _WIN32_WCE >= 0x600
extern "C" long __cdecl _InterlockedIncrement( long volatile * );
extern "C" long __cdecl _InterlockedDecrement( long volatile * );
extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long );
extern "C" long __cdecl _InterlockedExchange( long volatile *, long );
extern "C" long __cdecl _InterlockedExchangeAdd( long volatile *, long );
# define BOOST_INTERLOCKED_INCREMENT _InterlockedIncrement
# define BOOST_INTERLOCKED_DECREMENT _InterlockedDecrement
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange
# define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange
# define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd
#else
// under Windows CE we still have old-style Interlocked* functions
extern "C" long __cdecl InterlockedIncrement( long* );
extern "C" long __cdecl InterlockedDecrement( long* );
extern "C" long __cdecl InterlockedCompareExchange( long*, long, long );
extern "C" long __cdecl InterlockedExchange( long*, long );
extern "C" long __cdecl InterlockedExchangeAdd( long*, long );
# define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement
# define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange
# define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange
# define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd
#endif
# 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 )
#if defined( BOOST_MSVC ) && BOOST_MSVC >= 1400
#include <intrin.h>
#else
# if defined( __CLRCALL_PURE_OR_CDECL )
# define BOOST_INTERLOCKED_CLRCALL_PURE_OR_CDECL __CLRCALL_PURE_OR_CDECL
# else
# define BOOST_INTERLOCKED_CLRCALL_PURE_OR_CDECL __cdecl
# endif
extern "C" long BOOST_INTERLOCKED_CLRCALL_PURE_OR_CDECL _InterlockedIncrement( long volatile * );
extern "C" long BOOST_INTERLOCKED_CLRCALL_PURE_OR_CDECL _InterlockedDecrement( long volatile * );
extern "C" long BOOST_INTERLOCKED_CLRCALL_PURE_OR_CDECL _InterlockedCompareExchange( long volatile *, long, long );
extern "C" long BOOST_INTERLOCKED_CLRCALL_PURE_OR_CDECL _InterlockedExchange( long volatile *, long );
extern "C" long BOOST_INTERLOCKED_CLRCALL_PURE_OR_CDECL _InterlockedExchangeAdd( long volatile *, long );
# undef BOOST_INTERLOCKED_CLRCALL_PURE_OR_CDECL
# if defined( BOOST_MSVC ) && BOOST_MSVC >= 1310
# pragma intrinsic( _InterlockedIncrement )
# pragma intrinsic( _InterlockedDecrement )
# pragma intrinsic( _InterlockedCompareExchange )
# pragma intrinsic( _InterlockedExchange )
# pragma intrinsic( _InterlockedExchangeAdd )
# endif
#endif
# if defined(_M_IA64) || defined(_M_AMD64)
extern "C" void* __cdecl _InterlockedCompareExchangePointer( void* volatile *, void*, void* );
extern "C" void* __cdecl _InterlockedExchangePointer( void* volatile *, void* );
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER _InterlockedCompareExchangePointer
# define BOOST_INTERLOCKED_EXCHANGE_POINTER _InterlockedExchangePointer
# else
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))
# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange)))
# endif
# define BOOST_INTERLOCKED_INCREMENT _InterlockedIncrement
# define BOOST_INTERLOCKED_DECREMENT _InterlockedDecrement
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange
# define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange
# define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd
// Unlike __MINGW64__, __MINGW64_VERSION_MAJOR is defined by MinGW-w64 for both 32 and 64-bit targets.
#elif defined(__MINGW64_VERSION_MAJOR)
// MinGW-w64 provides intrin.h for both 32 and 64-bit targets.
#include <intrin.h>
# define BOOST_INTERLOCKED_INCREMENT _InterlockedIncrement
# define BOOST_INTERLOCKED_DECREMENT _InterlockedDecrement
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange
# define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange
# define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd
# if defined(__x86_64__) || defined(__x86_64)
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER _InterlockedCompareExchangePointer
# define BOOST_INTERLOCKED_EXCHANGE_POINTER _InterlockedExchangePointer
# else
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))
# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange)))
# endif
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ )
#define BOOST_INTERLOCKED_IMPORT __declspec(dllimport)
namespace boost
{
namespace detail
{
extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedIncrement( long volatile * );
extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedDecrement( long volatile * );
extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedCompareExchange( long volatile *, long, long );
extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedExchange( long volatile *, long );
extern "C" BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedExchangeAdd( long volatile *, long );
# if defined(_M_IA64) || defined(_M_AMD64)
extern "C" BOOST_INTERLOCKED_IMPORT void* __stdcall InterlockedCompareExchangePointer( void* volatile *, void*, void* );
extern "C" BOOST_INTERLOCKED_IMPORT void* __stdcall InterlockedExchangePointer( void* volatile *, void* );
# endif
} // namespace detail
} // namespace boost
# define BOOST_INTERLOCKED_INCREMENT ::boost::detail::InterlockedIncrement
# define BOOST_INTERLOCKED_DECREMENT ::boost::detail::InterlockedDecrement
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE ::boost::detail::InterlockedCompareExchange
# define BOOST_INTERLOCKED_EXCHANGE ::boost::detail::InterlockedExchange
# define BOOST_INTERLOCKED_EXCHANGE_ADD ::boost::detail::InterlockedExchangeAdd
# if defined(_M_IA64) || defined(_M_AMD64)
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER ::boost::detail::InterlockedCompareExchangePointer
# define BOOST_INTERLOCKED_EXCHANGE_POINTER ::boost::detail::InterlockedExchangePointer
# else
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))
# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange)))
# endif
#else
# error "Interlocked intrinsics not available"
#endif
#endif // #ifndef BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED
@@ -0,0 +1,125 @@
// Copyright David Abrahams 2004. Use, modification and distribution is
// subject to 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)
#ifndef IS_INCREMENTABLE_DWA200415_HPP
# define IS_INCREMENTABLE_DWA200415_HPP
# include <boost/type_traits/integral_constant.hpp>
# include <boost/type_traits/remove_cv.hpp>
# include <boost/mpl/aux_/lambda_support.hpp>
# include <boost/mpl/bool.hpp>
# include <boost/detail/workaround.hpp>
namespace boost { namespace detail {
// is_incrementable<T> metafunction
//
// Requires: Given x of type T&, if the expression ++x is well-formed
// it must have complete type; otherwise, it must neither be ambiguous
// nor violate access.
// This namespace ensures that ADL doesn't mess things up.
namespace is_incrementable_
{
// a type returned from operator++ when no increment is found in the
// type's own namespace
struct tag {};
// any soaks up implicit conversions and makes the following
// operator++ less-preferred than any other such operator that
// might be found via ADL.
struct any { template <class T> any(T const&); };
// This is a last-resort operator++ for when none other is found
# if BOOST_WORKAROUND(__GNUC__, == 4) && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 2
}
namespace is_incrementable_2
{
is_incrementable_::tag operator++(is_incrementable_::any const&);
is_incrementable_::tag operator++(is_incrementable_::any const&,int);
}
using namespace is_incrementable_2;
namespace is_incrementable_
{
# else
tag operator++(any const&);
tag operator++(any const&,int);
# endif
# 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
tag operator,(tag,int);
# define BOOST_comma(a,b) (a,b)
# endif
# if defined(BOOST_MSVC)
# pragma warning(push)
# pragma warning(disable:4913) // Warning about operator,
# endif
// two check overloads help us identify which operator++ was picked
char (& check_(tag) )[2];
template <class T>
char check_(T const&);
template <class T>
struct impl
{
static typename boost::remove_cv<T>::type& x;
BOOST_STATIC_CONSTANT(
bool
, value = sizeof(is_incrementable_::check_(BOOST_comma(++x,0))) == 1
);
};
template <class T>
struct postfix_impl
{
static typename boost::remove_cv<T>::type& x;
BOOST_STATIC_CONSTANT(
bool
, value = sizeof(is_incrementable_::check_(BOOST_comma(x++,0))) == 1
);
};
# if defined(BOOST_MSVC)
# pragma warning(pop)
# endif
}
# undef BOOST_comma
template<typename T>
struct is_incrementable :
public boost::integral_constant<bool, boost::detail::is_incrementable_::impl<T>::value>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_incrementable,(T))
};
template<typename T>
struct is_postfix_incrementable :
public boost::integral_constant<bool, boost::detail::is_incrementable_::postfix_impl<T>::value>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_postfix_incrementable,(T))
};
} // namespace detail
} // namespace boost
# include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // IS_INCREMENTABLE_DWA200415_HPP
@@ -0,0 +1,56 @@
/*==============================================================================
Copyright (c) 2010-2011 Bryce Lelbach
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)
==============================================================================*/
#ifndef BOOST_DETAIL_SORTED_HPP
#define BOOST_DETAIL_SORTED_HPP
#include <boost/detail/iterator.hpp>
#include <functional>
namespace boost {
namespace detail {
template<class Iterator, class Comp>
inline Iterator is_sorted_until (Iterator first, Iterator last, Comp c) {
if (first == last)
return last;
Iterator it = first; ++it;
for (; it != last; first = it, ++it)
if (c(*it, *first))
return it;
return it;
}
template<class Iterator>
inline Iterator is_sorted_until (Iterator first, Iterator last) {
typedef typename boost::detail::iterator_traits<Iterator>::value_type
value_type;
typedef std::less<value_type> c;
return ::boost::detail::is_sorted_until(first, last, c());
}
template<class Iterator, class Comp>
inline bool is_sorted (Iterator first, Iterator last, Comp c) {
return ::boost::detail::is_sorted_until(first, last, c) == last;
}
template<class Iterator>
inline bool is_sorted (Iterator first, Iterator last) {
return ::boost::detail::is_sorted_until(first, last) == last;
}
} // detail
} // boost
#endif // BOOST_DETAIL_SORTED_HPP
@@ -0,0 +1,27 @@
// Copyright David Abrahams 2005. 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)
#ifndef BOOST_DETAIL_IS_XXX_DWA20051011_HPP
# define BOOST_DETAIL_IS_XXX_DWA20051011_HPP
# include <boost/config.hpp>
# include <boost/mpl/bool.hpp>
# include <boost/preprocessor/enum_params.hpp>
# define BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs) \
template <class T> \
struct is_##name : mpl::false_ \
{ \
}; \
\
template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class T) > \
struct is_##name< \
qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, T) > \
> \
: mpl::true_ \
{ \
};
#endif // BOOST_DETAIL_IS_XXX_DWA20051011_HPP
@@ -0,0 +1,39 @@
// (C) Copyright David Abrahams 2002.
// 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)
#ifndef ITERATOR_DWA122600_HPP_
#define ITERATOR_DWA122600_HPP_
// This header is obsolete and will be deprecated.
#include <iterator>
#if defined(__SUNPRO_CC) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
#include <cstddef>
#endif
namespace boost
{
namespace detail
{
using std::iterator_traits;
using std::distance;
#if defined(__SUNPRO_CC) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
// std::distance from stlport with Oracle compiler 12.4 and 12.5 fails to deduce template parameters
// when one of the arguments is an array and the other one is a pointer.
template< typename T, std::size_t N >
inline typename std::iterator_traits< T* >::difference_type distance(T (&left)[N], T* right)
{
return std::distance(static_cast< T* >(left), right);
}
#endif
} // namespace detail
} // namespace boost
#endif // ITERATOR_DWA122600_HPP_
@@ -0,0 +1,185 @@
// Copyright Alexander Nasonov & Paul A. Bristow 2006.
// Use, modification and distribution are subject to 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)
#ifndef BOOST_DETAIL_LCAST_PRECISION_HPP_INCLUDED
#define BOOST_DETAIL_LCAST_PRECISION_HPP_INCLUDED
#include <climits>
#include <ios>
#include <limits>
#include <boost/config.hpp>
#include <boost/integer_traits.hpp>
#ifndef BOOST_NO_IS_ABSTRACT
// Fix for SF:1358600 - lexical_cast & pure virtual functions & VC 8 STL
#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_abstract.hpp>
#endif
#if defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || \
(defined(BOOST_MSVC) && (BOOST_MSVC<1310))
#define BOOST_LCAST_NO_COMPILE_TIME_PRECISION
#endif
#ifdef BOOST_LCAST_NO_COMPILE_TIME_PRECISION
#include <boost/assert.hpp>
#else
#include <boost/static_assert.hpp>
#endif
namespace boost { namespace detail {
class lcast_abstract_stub {};
#ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION
// Calculate an argument to pass to std::ios_base::precision from
// lexical_cast. See alternative implementation for broken standard
// libraries in lcast_get_precision below. Keep them in sync, please.
template<class T>
struct lcast_precision
{
#ifdef BOOST_NO_IS_ABSTRACT
typedef std::numeric_limits<T> limits; // No fix for SF:1358600.
#else
typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_<
boost::is_abstract<T>
, std::numeric_limits<lcast_abstract_stub>
, std::numeric_limits<T>
>::type limits;
#endif
BOOST_STATIC_CONSTANT(bool, use_default_precision =
!limits::is_specialized || limits::is_exact
);
BOOST_STATIC_CONSTANT(bool, is_specialized_bin =
!use_default_precision &&
limits::radix == 2 && limits::digits > 0
);
BOOST_STATIC_CONSTANT(bool, is_specialized_dec =
!use_default_precision &&
limits::radix == 10 && limits::digits10 > 0
);
BOOST_STATIC_CONSTANT(std::streamsize, streamsize_max =
boost::integer_traits<std::streamsize>::const_max
);
BOOST_STATIC_CONSTANT(unsigned int, precision_dec = limits::digits10 + 1U);
BOOST_STATIC_ASSERT(!is_specialized_dec ||
precision_dec <= streamsize_max + 0UL
);
BOOST_STATIC_CONSTANT(unsigned long, precision_bin =
2UL + limits::digits * 30103UL / 100000UL
);
BOOST_STATIC_ASSERT(!is_specialized_bin ||
(limits::digits + 0UL < ULONG_MAX / 30103UL &&
precision_bin > limits::digits10 + 0UL &&
precision_bin <= streamsize_max + 0UL)
);
BOOST_STATIC_CONSTANT(std::streamsize, value =
is_specialized_bin ? precision_bin
: is_specialized_dec ? precision_dec : 6
);
};
#endif
template<class T>
inline std::streamsize lcast_get_precision(T* = 0)
{
#ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION
return lcast_precision<T>::value;
#else // Follow lcast_precision algorithm at run-time:
#ifdef BOOST_NO_IS_ABSTRACT
typedef std::numeric_limits<T> limits; // No fix for SF:1358600.
#else
typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_<
boost::is_abstract<T>
, std::numeric_limits<lcast_abstract_stub>
, std::numeric_limits<T>
>::type limits;
#endif
bool const use_default_precision =
!limits::is_specialized || limits::is_exact;
if(!use_default_precision)
{ // Includes all built-in floating-point types, float, double ...
// and UDT types for which digits (significand bits) is defined (not zero)
bool const is_specialized_bin =
limits::radix == 2 && limits::digits > 0;
bool const is_specialized_dec =
limits::radix == 10 && limits::digits10 > 0;
std::streamsize const streamsize_max =
(boost::integer_traits<std::streamsize>::max)();
(void)streamsize_max;
if(is_specialized_bin)
{ // Floating-point types with
// limits::digits defined by the specialization.
unsigned long const digits = limits::digits;
unsigned long const precision = 2UL + digits * 30103UL / 100000UL;
// unsigned long is selected because it is at least 32-bits
// and thus ULONG_MAX / 30103UL is big enough for all types.
BOOST_ASSERT(
digits < ULONG_MAX / 30103UL &&
precision > limits::digits10 + 0UL &&
precision <= streamsize_max + 0UL
);
return precision;
}
else if(is_specialized_dec)
{ // Decimal Floating-point type, most likely a User Defined Type
// rather than a real floating-point hardware type.
unsigned int const precision = limits::digits10 + 1U;
BOOST_ASSERT(precision <= streamsize_max + 0UL);
return precision;
}
}
// Integral type (for which precision has no effect)
// or type T for which limits is NOT specialized,
// so assume stream precision remains the default 6 decimal digits.
// Warning: if your User-defined Floating-point type T is NOT specialized,
// then you may lose accuracy by only using 6 decimal digits.
// To avoid this, you need to specialize T with either
// radix == 2 and digits == the number of significand bits,
// OR
// radix = 10 and digits10 == the number of decimal digits.
return 6;
#endif
}
template<class T>
inline void lcast_set_precision(std::ios_base& stream, T*)
{
stream.precision(lcast_get_precision<T>());
}
template<class Source, class Target>
inline void lcast_set_precision(std::ios_base& stream, Source*, Target*)
{
std::streamsize const s = lcast_get_precision(static_cast<Source*>(0));
std::streamsize const t = lcast_get_precision(static_cast<Target*>(0));
stream.precision(s > t ? s : t);
}
}}
#endif // BOOST_DETAIL_LCAST_PRECISION_HPP_INCLUDED
@@ -0,0 +1,36 @@
// boost/detail/lightweight_main.hpp -------------------------------------------------//
// Copyright Beman Dawes 2010
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#include <iostream>
#include <exception>
//--------------------------------------------------------------------------------------//
// //
// exception reporting main() that calls cpp_main() //
// //
//--------------------------------------------------------------------------------------//
int cpp_main(int argc, char* argv[]);
int main(int argc, char* argv[])
{
try
{
return cpp_main(argc, argv);
}
catch (const std::exception& ex)
{
std::cout
<< "\nERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR\n"
<< "\n****************************** std::exception *****************************\n"
<< ex.what()
<< "\n***************************************************************************\n"
<< std::endl;
}
return 1;
}
@@ -0,0 +1,22 @@
#ifndef BOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED
#define BOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
//
// boost/detail/lightweight_mutex.hpp - lightweight mutex
//
// Copyright (c) 2002, 2003 Peter Dimov and Multi Media Ltd.
//
// 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/lightweight_mutex.hpp>
#endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED
@@ -0,0 +1,17 @@
/*
* Copyright (c) 2014 Glen Fernandes
*
* 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)
*/
#ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP
#define BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP
// The header file at this path is deprecated;
// use boost/core/lightweight_test.hpp instead.
#include <boost/core/lightweight_test.hpp>
#endif
@@ -0,0 +1,56 @@
// boost/detail/lightweight_test_reporter.hpp ----------------------------------------//
// Copyright Beman Dawes 2014
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
//--------------------------------------------------------------------------------------//
// //
// Configuration reporting cpp_main() //
// //
// Displays configuration information, then returns test_main(argc, argv), which //
// must be supplied by the user. //
// //
// Note: cpp_main(argc, argv) is called from a try block in main(), which is //
// supplied by <boost/detail/lightweight_main.hpp> as is a catch block that reports //
// std::exception what(). //
// //
//--------------------------------------------------------------------------------------//
#include <boost/config.hpp>
#include <boost/version.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/detail/lightweight_main.hpp>
#include <iostream>
int test_main(int argc, char* argv[]);
int cpp_main(int argc, char* argv[])
{
std::cout << BOOST_COMPILER
#ifdef __GNUC__
<< ", __GXX_EXPERIMENTAL_CXX0X__ "
# ifdef __GXX_EXPERIMENTAL_CXX0X__
"defined"
# else
"not defined"
# endif
#endif
<< "\n"
<< BOOST_STDLIB << "\n"
<< BOOST_PLATFORM << "\n"
<< "Boost version " << BOOST_VERSION / 100000 << '.'
<< BOOST_VERSION / 100 % 1000 << '.' << BOOST_VERSION % 100 << "\n";
std::cout << "Command line: ";
for (int a = 0; a < argc; ++a)
{
std::cout << argv[a];
if (a != argc - 1)
std::cout << ' ';
}
std::cout << std::endl;
return test_main(argc, argv);
}
@@ -0,0 +1,135 @@
#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
@@ -0,0 +1,177 @@
// (C) Copyright Jeremy Siek 2001.
// 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)
// Revision History:
// 04 Oct 2001 David Abrahams
// Changed name of "bind" to "select" to avoid problems with MSVC.
#ifndef BOOST_DETAIL_NAMED_TEMPLATE_PARAMS_HPP
#define BOOST_DETAIL_NAMED_TEMPLATE_PARAMS_HPP
#include <boost/type_traits/conversion_traits.hpp>
#include <boost/type_traits/composite_traits.hpp> // for is_reference
#if defined(__BORLANDC__)
#include <boost/type_traits/ice.hpp>
#endif
namespace boost {
namespace detail {
struct default_argument { };
struct dummy_default_gen {
template <class Base, class Traits>
struct select {
typedef default_argument type;
};
};
// This class template is a workaround for MSVC.
template <class Gen> struct default_generator {
typedef detail::dummy_default_gen type;
};
template <class T> struct is_default {
enum { value = false };
typedef type_traits::no_type type;
};
template <> struct is_default<default_argument> {
enum { value = true };
typedef type_traits::yes_type type;
};
struct choose_default {
template <class Arg, class DefaultGen, class Base, class Traits>
struct select {
typedef typename default_generator<DefaultGen>::type Gen;
typedef typename Gen::template select<Base,Traits>::type type;
};
};
struct choose_arg {
template <class Arg, class DefaultGen, class Base, class Traits>
struct select {
typedef Arg type;
};
};
#if defined(__BORLANDC__)
template <class UseDefault>
struct choose_arg_or_default { typedef choose_arg type; };
template <>
struct choose_arg_or_default<type_traits::yes_type> {
typedef choose_default type;
};
#else
template <bool UseDefault>
struct choose_arg_or_default { typedef choose_arg type; };
template <>
struct choose_arg_or_default<true> {
typedef choose_default type;
};
#endif
template <class Arg, class DefaultGen, class Base, class Traits>
class resolve_default {
#if defined(__BORLANDC__)
typedef typename choose_arg_or_default<typename is_default<Arg>::type>::type Selector;
#else
// This usually works for Borland, but I'm seeing weird errors in
// iterator_adaptor_test.cpp when using this method.
enum { is_def = is_default<Arg>::value };
typedef typename choose_arg_or_default<is_def>::type Selector;
#endif
public:
typedef typename Selector
::template select<Arg, DefaultGen, Base, Traits>::type type;
};
// To differentiate an unnamed parameter from a traits generator
// we use is_convertible<X, iter_traits_gen_base>.
struct named_template_param_base { };
template <class X>
struct is_named_param_list {
enum { value = is_convertible<X, named_template_param_base>::value };
};
struct choose_named_params {
template <class Prev> struct select { typedef Prev type; };
};
struct choose_default_arg {
template <class Prev> struct select {
typedef detail::default_argument type;
};
};
template <bool Named> struct choose_default_dispatch_;
template <> struct choose_default_dispatch_<true> {
typedef choose_named_params type;
};
template <> struct choose_default_dispatch_<false> {
typedef choose_default_arg type;
};
// The use of inheritance here is a Solaris Forte 6 workaround.
template <bool Named> struct choose_default_dispatch
: public choose_default_dispatch_<Named> { };
template <class PreviousArg>
struct choose_default_argument {
enum { is_named = is_named_param_list<PreviousArg>::value };
typedef typename choose_default_dispatch<is_named>::type Selector;
typedef typename Selector::template select<PreviousArg>::type type;
};
// This macro assumes that there is a class named default_##TYPE
// defined before the application of the macro. This class should
// have a single member class template named "select" with two
// template parameters: the type of the class being created (e.g.,
// the iterator_adaptor type when creating iterator adaptors) and
// a traits class. The select class should have a single typedef
// named "type" that produces the default for TYPE. See
// boost/iterator_adaptors.hpp for an example usage. Also,
// applications of this macro must be placed in namespace
// boost::detail.
#define BOOST_NAMED_TEMPLATE_PARAM(TYPE) \
struct get_##TYPE##_from_named { \
template <class Base, class NamedParams, class Traits> \
struct select { \
typedef typename NamedParams::traits NamedTraits; \
typedef typename NamedTraits::TYPE TYPE; \
typedef typename resolve_default<TYPE, \
default_##TYPE, Base, NamedTraits>::type type; \
}; \
}; \
struct pass_thru_##TYPE { \
template <class Base, class Arg, class Traits> struct select { \
typedef typename resolve_default<Arg, \
default_##TYPE, Base, Traits>::type type; \
};\
}; \
template <int NamedParam> \
struct get_##TYPE##_dispatch { }; \
template <> struct get_##TYPE##_dispatch<1> { \
typedef get_##TYPE##_from_named type; \
}; \
template <> struct get_##TYPE##_dispatch<0> { \
typedef pass_thru_##TYPE type; \
}; \
template <class Base, class X, class Traits> \
class get_##TYPE { \
enum { is_named = is_named_param_list<X>::value }; \
typedef typename get_##TYPE##_dispatch<is_named>::type Selector; \
public: \
typedef typename Selector::template select<Base, X, Traits>::type type; \
}; \
template <> struct default_generator<default_##TYPE> { \
typedef default_##TYPE type; \
}
} // namespace detail
} // namespace boost
#endif // BOOST_DETAIL_NAMED_TEMPLATE_PARAMS_HPP
@@ -0,0 +1,17 @@
/*
* Copyright (c) 2014 Glen Fernandes
*
* 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)
*/
#ifndef BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP
#define BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP
// The header file at this path is deprecated;
// use boost/core/no_exceptions_support.hpp instead.
#include <boost/core/no_exceptions_support.hpp>
#endif
@@ -0,0 +1,182 @@
// (C) Copyright David Abrahams 2001, Howard Hinnant 2001.
//
// 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)
//
// Template class numeric_traits<Number> --
//
// Supplies:
//
// typedef difference_type -- a type used to represent the difference
// between any two values of Number.
//
// Support:
// 1. Not all specializations are supplied
//
// 2. Use of specializations that are not supplied will cause a
// compile-time error
//
// 3. Users are free to specialize numeric_traits for any type.
//
// 4. Right now, specializations are only supplied for integer types.
//
// 5. On implementations which do not supply compile-time constants in
// std::numeric_limits<>, only specializations for built-in integer types
// are supplied.
//
// 6. Handling of numbers whose range of representation is at least as
// great as boost::intmax_t can cause some differences to be
// unrepresentable in difference_type:
//
// Number difference_type
// ------ ---------------
// signed Number
// unsigned intmax_t
//
// template <class Number> typename numeric_traits<Number>::difference_type
// numeric_distance(Number x, Number y)
// computes (y - x), attempting to avoid overflows.
//
// See http://www.boost.org for most recent version including documentation.
// Revision History
// 11 Feb 2001 - Use BOOST_STATIC_CONSTANT (David Abrahams)
// 11 Feb 2001 - Rolled back ineffective Borland-specific code
// (David Abrahams)
// 10 Feb 2001 - Rolled in supposed Borland fixes from John Maddock, but
// not seeing any improvement yet (David Abrahams)
// 06 Feb 2001 - Factored if_true out into boost/detail/select_type.hpp
// (David Abrahams)
// 23 Jan 2001 - Fixed logic of difference_type selection, which was
// completely wack. In the process, added digit_traits<>
// to compute the number of digits in intmax_t even when
// not supplied by numeric_limits<>. (David Abrahams)
// 21 Jan 2001 - Created (David Abrahams)
#ifndef BOOST_NUMERIC_TRAITS_HPP_DWA20001901
# define BOOST_NUMERIC_TRAITS_HPP_DWA20001901
# include <boost/config.hpp>
# include <boost/cstdint.hpp>
# include <boost/static_assert.hpp>
# include <boost/type_traits.hpp>
# include <boost/detail/select_type.hpp>
# include <boost/limits.hpp>
namespace boost { namespace detail {
// Template class is_signed -- determine whether a numeric type is signed
// Requires that T is constructable from the literals -1 and 0. Compile-time
// error results if that requirement is not met (and thus signedness is not
// likely to have meaning for that type).
template <class Number>
struct is_signed
{
#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);
#endif
};
# ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
// digit_traits - compute the number of digits in a built-in integer
// type. Needed for implementations on which numeric_limits is not specialized
// for intmax_t (e.g. VC6).
template <bool is_specialized> struct digit_traits_select;
// numeric_limits is specialized; just select that version of digits
template <> struct digit_traits_select<true>
{
template <class T> struct traits
{
BOOST_STATIC_CONSTANT(int, digits = std::numeric_limits<T>::digits);
};
};
// numeric_limits is not specialized; compute digits from sizeof(T)
template <> struct digit_traits_select<false>
{
template <class T> struct traits
{
BOOST_STATIC_CONSTANT(int, digits = (
sizeof(T) * std::numeric_limits<unsigned char>::digits
- (is_signed<T>::value ? 1 : 0))
);
};
};
// here's the "usable" template
template <class T> struct digit_traits
{
typedef digit_traits_select<
::std::numeric_limits<T>::is_specialized> selector;
typedef typename selector::template traits<T> traits;
BOOST_STATIC_CONSTANT(int, digits = traits::digits);
};
#endif
// Template class integer_traits<Integer> -- traits of various integer types
// This should probably be rolled into boost::integer_traits one day, but I
// need it to work without <limits>
template <class Integer>
struct integer_traits
{
# ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
private:
typedef Integer integer_type;
typedef std::numeric_limits<integer_type> x;
public:
typedef typename
if_true<(int(x::is_signed)
&& (!int(x::is_bounded)
// digits is the number of no-sign bits
|| (int(x::digits) + 1 >= digit_traits<boost::intmax_t>::digits)))>::template then<
Integer,
typename if_true<(int(x::digits) + 1 < digit_traits<signed int>::digits)>::template then<
signed int,
typename if_true<(int(x::digits) + 1 < digit_traits<signed long>::digits)>::template then<
signed long,
// else
intmax_t
>::type>::type>::type difference_type;
#else
BOOST_STATIC_ASSERT(boost::is_integral<Integer>::value);
typedef typename
if_true<(sizeof(Integer) >= sizeof(intmax_t))>::template then<
typename if_true<(is_signed<Integer>::value)>::template then<
Integer,
intmax_t
>::type,
typename if_true<(sizeof(Integer) < sizeof(std::ptrdiff_t))>::template then<
std::ptrdiff_t,
intmax_t
>::type
>::type difference_type;
# endif
};
// Right now, only supports integers, but should be expanded.
template <class Number>
struct numeric_traits
{
typedef typename integer_traits<Number>::difference_type difference_type;
};
template <class Number>
typename numeric_traits<Number>::difference_type numeric_distance(Number x, Number y)
{
typedef typename numeric_traits<Number>::difference_type difference_type;
return difference_type(y) - difference_type(x);
}
}}
#endif // BOOST_NUMERIC_TRAITS_HPP_DWA20001901
@@ -0,0 +1,499 @@
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
// Use, modification and distribution are subject to 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).
//
// See http://www.boost.org/libs/utility for most recent version including documentation.
// see libs/utility/compressed_pair.hpp
//
/* Release notes:
20 Jan 2001:
Fixed obvious bugs (David Abrahams)
07 Oct 2000:
Added better single argument constructor support.
03 Oct 2000:
Added VC6 support (JM).
23rd July 2000:
Additional comments added. (JM)
Jan 2000:
Original version: this version crippled for use with crippled compilers
- John Maddock Jan 2000.
*/
#ifndef BOOST_OB_COMPRESSED_PAIR_HPP
#define BOOST_OB_COMPRESSED_PAIR_HPP
#include <algorithm>
#ifndef BOOST_OBJECT_TYPE_TRAITS_HPP
#include <boost/type_traits/object_traits.hpp>
#endif
#ifndef BOOST_SAME_TRAITS_HPP
#include <boost/type_traits/same_traits.hpp>
#endif
#ifndef BOOST_CALL_TRAITS_HPP
#include <boost/call_traits.hpp>
#endif
namespace boost
{
#ifdef BOOST_MSVC6_MEMBER_TEMPLATES
//
// use member templates to emulate
// partial specialisation. Note that due to
// problems with overload resolution with VC6
// each of the compressed_pair versions that follow
// have one template single-argument constructor
// in place of two specific constructors:
//
template <class T1, class T2>
class compressed_pair;
namespace detail{
template <class A, class T1, class T2>
struct best_conversion_traits
{
typedef char one;
typedef char (&two)[2];
static A a;
static one test(T1);
static two test(T2);
enum { value = sizeof(test(a)) };
};
template <int>
struct init_one;
template <>
struct init_one<1>
{
template <class A, class T1, class T2>
static void init(const A& a, T1* p1, T2*)
{
*p1 = a;
}
};
template <>
struct init_one<2>
{
template <class A, class T1, class T2>
static void init(const A& a, T1*, T2* p2)
{
*p2 = a;
}
};
// T1 != T2, both non-empty
template <class T1, class T2>
class compressed_pair_0
{
private:
T1 _first;
T2 _second;
public:
typedef T1 first_type;
typedef T2 second_type;
typedef typename call_traits<first_type>::param_type first_param_type;
typedef typename call_traits<second_type>::param_type second_param_type;
typedef typename call_traits<first_type>::reference first_reference;
typedef typename call_traits<second_type>::reference second_reference;
typedef typename call_traits<first_type>::const_reference first_const_reference;
typedef typename call_traits<second_type>::const_reference second_const_reference;
compressed_pair_0() : _first(), _second() {}
compressed_pair_0(first_param_type x, second_param_type y) : _first(x), _second(y) {}
template <class A>
explicit compressed_pair_0(const A& val)
{
init_one<best_conversion_traits<A, T1, T2>::value>::init(val, &_first, &_second);
}
compressed_pair_0(const ::boost::compressed_pair<T1,T2>& x)
: _first(x.first()), _second(x.second()) {}
#if 0
compressed_pair_0& operator=(const compressed_pair_0& x) {
cout << "assigning compressed pair 0" << endl;
_first = x._first;
_second = x._second;
cout << "finished assigning compressed pair 0" << endl;
return *this;
}
#endif
first_reference first() { return _first; }
first_const_reference first() const { return _first; }
second_reference second() { return _second; }
second_const_reference second() const { return _second; }
void swap(compressed_pair_0& y)
{
using std::swap;
swap(_first, y._first);
swap(_second, y._second);
}
};
// T1 != T2, T2 empty
template <class T1, class T2>
class compressed_pair_1 : T2
{
private:
T1 _first;
public:
typedef T1 first_type;
typedef T2 second_type;
typedef typename call_traits<first_type>::param_type first_param_type;
typedef typename call_traits<second_type>::param_type second_param_type;
typedef typename call_traits<first_type>::reference first_reference;
typedef typename call_traits<second_type>::reference second_reference;
typedef typename call_traits<first_type>::const_reference first_const_reference;
typedef typename call_traits<second_type>::const_reference second_const_reference;
compressed_pair_1() : T2(), _first() {}
compressed_pair_1(first_param_type x, second_param_type y) : T2(y), _first(x) {}
template <class A>
explicit compressed_pair_1(const A& val)
{
init_one<best_conversion_traits<A, T1, T2>::value>::init(val, &_first, static_cast<T2*>(this));
}
compressed_pair_1(const ::boost::compressed_pair<T1,T2>& x)
: T2(x.second()), _first(x.first()) {}
first_reference first() { return _first; }
first_const_reference first() const { return _first; }
second_reference second() { return *this; }
second_const_reference second() const { return *this; }
void swap(compressed_pair_1& y)
{
// no need to swap empty base class:
using std::swap;
swap(_first, y._first);
}
};
// T1 != T2, T1 empty
template <class T1, class T2>
class compressed_pair_2 : T1
{
private:
T2 _second;
public:
typedef T1 first_type;
typedef T2 second_type;
typedef typename call_traits<first_type>::param_type first_param_type;
typedef typename call_traits<second_type>::param_type second_param_type;
typedef typename call_traits<first_type>::reference first_reference;
typedef typename call_traits<second_type>::reference second_reference;
typedef typename call_traits<first_type>::const_reference first_const_reference;
typedef typename call_traits<second_type>::const_reference second_const_reference;
compressed_pair_2() : T1(), _second() {}
compressed_pair_2(first_param_type x, second_param_type y) : T1(x), _second(y) {}
template <class A>
explicit compressed_pair_2(const A& val)
{
init_one<best_conversion_traits<A, T1, T2>::value>::init(val, static_cast<T1*>(this), &_second);
}
compressed_pair_2(const ::boost::compressed_pair<T1,T2>& x)
: T1(x.first()), _second(x.second()) {}
#if 0
compressed_pair_2& operator=(const compressed_pair_2& x) {
cout << "assigning compressed pair 2" << endl;
T1::operator=(x);
_second = x._second;
cout << "finished assigning compressed pair 2" << endl;
return *this;
}
#endif
first_reference first() { return *this; }
first_const_reference first() const { return *this; }
second_reference second() { return _second; }
second_const_reference second() const { return _second; }
void swap(compressed_pair_2& y)
{
// no need to swap empty base class:
using std::swap;
swap(_second, y._second);
}
};
// T1 != T2, both empty
template <class T1, class T2>
class compressed_pair_3 : T1, T2
{
public:
typedef T1 first_type;
typedef T2 second_type;
typedef typename call_traits<first_type>::param_type first_param_type;
typedef typename call_traits<second_type>::param_type second_param_type;
typedef typename call_traits<first_type>::reference first_reference;
typedef typename call_traits<second_type>::reference second_reference;
typedef typename call_traits<first_type>::const_reference first_const_reference;
typedef typename call_traits<second_type>::const_reference second_const_reference;
compressed_pair_3() : T1(), T2() {}
compressed_pair_3(first_param_type x, second_param_type y) : T1(x), T2(y) {}
template <class A>
explicit compressed_pair_3(const A& val)
{
init_one<best_conversion_traits<A, T1, T2>::value>::init(val, static_cast<T1*>(this), static_cast<T2*>(this));
}
compressed_pair_3(const ::boost::compressed_pair<T1,T2>& x)
: T1(x.first()), T2(x.second()) {}
first_reference first() { return *this; }
first_const_reference first() const { return *this; }
second_reference second() { return *this; }
second_const_reference second() const { return *this; }
void swap(compressed_pair_3& y)
{
// no need to swap empty base classes:
}
};
// T1 == T2, and empty
template <class T1, class T2>
class compressed_pair_4 : T1
{
public:
typedef T1 first_type;
typedef T2 second_type;
typedef typename call_traits<first_type>::param_type first_param_type;
typedef typename call_traits<second_type>::param_type second_param_type;
typedef typename call_traits<first_type>::reference first_reference;
typedef typename call_traits<second_type>::reference second_reference;
typedef typename call_traits<first_type>::const_reference first_const_reference;
typedef typename call_traits<second_type>::const_reference second_const_reference;
compressed_pair_4() : T1() {}
compressed_pair_4(first_param_type x, second_param_type y) : T1(x), m_second(y) {}
// only one single argument constructor since T1 == T2
explicit compressed_pair_4(first_param_type x) : T1(x), m_second(x) {}
compressed_pair_4(const ::boost::compressed_pair<T1,T2>& x)
: T1(x.first()), m_second(x.second()) {}
first_reference first() { return *this; }
first_const_reference first() const { return *this; }
second_reference second() { return m_second; }
second_const_reference second() const { return m_second; }
void swap(compressed_pair_4& y)
{
// no need to swap empty base classes:
}
private:
T2 m_second;
};
// T1 == T2, not empty
template <class T1, class T2>
class compressed_pair_5
{
private:
T1 _first;
T2 _second;
public:
typedef T1 first_type;
typedef T2 second_type;
typedef typename call_traits<first_type>::param_type first_param_type;
typedef typename call_traits<second_type>::param_type second_param_type;
typedef typename call_traits<first_type>::reference first_reference;
typedef typename call_traits<second_type>::reference second_reference;
typedef typename call_traits<first_type>::const_reference first_const_reference;
typedef typename call_traits<second_type>::const_reference second_const_reference;
compressed_pair_5() : _first(), _second() {}
compressed_pair_5(first_param_type x, second_param_type y) : _first(x), _second(y) {}
// only one single argument constructor since T1 == T2
explicit compressed_pair_5(first_param_type x) : _first(x), _second(x) {}
compressed_pair_5(const ::boost::compressed_pair<T1,T2>& c)
: _first(c.first()), _second(c.second()) {}
first_reference first() { return _first; }
first_const_reference first() const { return _first; }
second_reference second() { return _second; }
second_const_reference second() const { return _second; }
void swap(compressed_pair_5& y)
{
using std::swap;
swap(_first, y._first);
swap(_second, y._second);
}
};
template <bool e1, bool e2, bool same>
struct compressed_pair_chooser
{
template <class T1, class T2>
struct rebind
{
typedef compressed_pair_0<T1, T2> type;
};
};
template <>
struct compressed_pair_chooser<false, true, false>
{
template <class T1, class T2>
struct rebind
{
typedef compressed_pair_1<T1, T2> type;
};
};
template <>
struct compressed_pair_chooser<true, false, false>
{
template <class T1, class T2>
struct rebind
{
typedef compressed_pair_2<T1, T2> type;
};
};
template <>
struct compressed_pair_chooser<true, true, false>
{
template <class T1, class T2>
struct rebind
{
typedef compressed_pair_3<T1, T2> type;
};
};
template <>
struct compressed_pair_chooser<true, true, true>
{
template <class T1, class T2>
struct rebind
{
typedef compressed_pair_4<T1, T2> type;
};
};
template <>
struct compressed_pair_chooser<false, false, true>
{
template <class T1, class T2>
struct rebind
{
typedef compressed_pair_5<T1, T2> type;
};
};
template <class T1, class T2>
struct compressed_pair_traits
{
private:
typedef compressed_pair_chooser<is_empty<T1>::value, is_empty<T2>::value, is_same<T1,T2>::value> chooser;
typedef typename chooser::template rebind<T1, T2> bound_type;
public:
typedef typename bound_type::type type;
};
} // namespace detail
template <class T1, class T2>
class compressed_pair : public detail::compressed_pair_traits<T1, T2>::type
{
private:
typedef typename detail::compressed_pair_traits<T1, T2>::type base_type;
public:
typedef T1 first_type;
typedef T2 second_type;
typedef typename call_traits<first_type>::param_type first_param_type;
typedef typename call_traits<second_type>::param_type second_param_type;
typedef typename call_traits<first_type>::reference first_reference;
typedef typename call_traits<second_type>::reference second_reference;
typedef typename call_traits<first_type>::const_reference first_const_reference;
typedef typename call_traits<second_type>::const_reference second_const_reference;
compressed_pair() : base_type() {}
compressed_pair(first_param_type x, second_param_type y) : base_type(x, y) {}
template <class A>
explicit compressed_pair(const A& x) : base_type(x){}
first_reference first() { return base_type::first(); }
first_const_reference first() const { return base_type::first(); }
second_reference second() { return base_type::second(); }
second_const_reference second() const { return base_type::second(); }
};
template <class T1, class T2>
inline void swap(compressed_pair<T1, T2>& x, compressed_pair<T1, T2>& y)
{
x.swap(y);
}
#else
// no partial specialisation, no member templates:
template <class T1, class T2>
class compressed_pair
{
private:
T1 _first;
T2 _second;
public:
typedef T1 first_type;
typedef T2 second_type;
typedef typename call_traits<first_type>::param_type first_param_type;
typedef typename call_traits<second_type>::param_type second_param_type;
typedef typename call_traits<first_type>::reference first_reference;
typedef typename call_traits<second_type>::reference second_reference;
typedef typename call_traits<first_type>::const_reference first_const_reference;
typedef typename call_traits<second_type>::const_reference second_const_reference;
compressed_pair() : _first(), _second() {}
compressed_pair(first_param_type x, second_param_type y) : _first(x), _second(y) {}
explicit compressed_pair(first_param_type x) : _first(x), _second() {}
// can't define this in case T1 == T2:
// explicit compressed_pair(second_param_type y) : _first(), _second(y) {}
first_reference first() { return _first; }
first_const_reference first() const { return _first; }
second_reference second() { return _second; }
second_const_reference second() const { return _second; }
void swap(compressed_pair& y)
{
using std::swap;
swap(_first, y._first);
swap(_second, y._second);
}
};
template <class T1, class T2>
inline void swap(compressed_pair<T1, T2>& x, compressed_pair<T1, T2>& y)
{
x.swap(y);
}
#endif
} // boost
#endif // BOOST_OB_COMPRESSED_PAIR_HPP
@@ -0,0 +1,23 @@
#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
@@ -0,0 +1,120 @@
//-----------------------------------------------------------------------------
// boost detail/reference_content.hpp header file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2003
// Eric Friedman
//
// 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)
#ifndef BOOST_DETAIL_REFERENCE_CONTENT_HPP
#define BOOST_DETAIL_REFERENCE_CONTENT_HPP
#include "boost/config.hpp"
# include "boost/mpl/bool.hpp"
# include "boost/type_traits/has_nothrow_copy.hpp"
#include "boost/mpl/void.hpp"
namespace boost {
namespace detail {
///////////////////////////////////////////////////////////////////////////////
// (detail) class template reference_content
//
// Non-Assignable wrapper for references.
//
template <typename RefT>
class reference_content
{
private: // representation
RefT content_;
public: // structors
~reference_content()
{
}
reference_content(RefT r)
: content_( r )
{
}
reference_content(const reference_content& operand)
: content_( operand.content_ )
{
}
private: // non-Assignable
reference_content& operator=(const reference_content&);
public: // queries
RefT get() const
{
return content_;
}
};
///////////////////////////////////////////////////////////////////////////////
// (detail) metafunction make_reference_content
//
// Wraps with reference_content if specified type is reference.
//
template <typename T = mpl::void_> struct make_reference_content;
template <typename T>
struct make_reference_content
{
typedef T type;
};
template <typename T>
struct make_reference_content< T& >
{
typedef reference_content<T&> type;
};
template <>
struct make_reference_content< mpl::void_ >
{
template <typename T>
struct apply
: make_reference_content<T>
{
};
typedef mpl::void_ type;
};
} // namespace detail
///////////////////////////////////////////////////////////////////////////////
// reference_content<T&> type traits specializations
//
template <typename T>
struct has_nothrow_copy<
::boost::detail::reference_content< T& >
>
: mpl::true_
{
};
} // namespace boost
#endif // BOOST_DETAIL_REFERENCE_CONTENT_HPP
@@ -0,0 +1,17 @@
/*
* Copyright (c) 2014 Andrey Semashev
*
* 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)
*/
#ifndef BOOST_DETAIL_SCOPED_ENUM_EMULATION_HPP
#define BOOST_DETAIL_SCOPED_ENUM_EMULATION_HPP
// The header file at this path is deprecated;
// use boost/core/scoped_enum.hpp instead.
#include <boost/core/scoped_enum.hpp>
#endif
@@ -0,0 +1,36 @@
// (C) Copyright David Abrahams 2001.
// 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)
//
// See http://www.boost.org for most recent version including documentation.
// Revision History
// 09 Feb 01 Applied John Maddock's Borland patch Moving <true>
// specialization to unspecialized template (David Abrahams)
// 06 Feb 01 Created (David Abrahams)
#ifndef SELECT_TYPE_DWA20010206_HPP
# define SELECT_TYPE_DWA20010206_HPP
namespace boost { namespace detail {
// Template class if_true -- select among 2 types based on a bool constant expression
// Usage:
// typename if_true<(bool_const_expression)>::template then<true_type, false_type>::type
// HP aCC cannot deal with missing names for template value parameters
template <bool b> struct if_true
{
template <class T, class F>
struct then { typedef T type; };
};
template <>
struct if_true<false>
{
template <class T, class F>
struct then { typedef F type; };
};
}}
#endif // SELECT_TYPE_DWA20010206_HPP
@@ -0,0 +1,36 @@
#ifndef BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED
#define BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
// detail/sp_typeinfo.hpp
//
// Deprecated, please use boost/core/typeinfo.hpp
//
// Copyright 2007 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/core/typeinfo.hpp>
namespace boost
{
namespace detail
{
typedef boost::core::typeinfo sp_typeinfo;
} // namespace detail
} // namespace boost
#define BOOST_SP_TYPEID(T) BOOST_CORE_TYPEID(T)
#endif // #ifndef BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED
@@ -0,0 +1,74 @@
//-----------------------------------------------------------------------------
// boost detail/templated_streams.hpp header file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2003
// Eric Friedman
//
// 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)
#ifndef BOOST_DETAIL_TEMPLATED_STREAMS_HPP
#define BOOST_DETAIL_TEMPLATED_STREAMS_HPP
#include "boost/config.hpp"
///////////////////////////////////////////////////////////////////////////////
// (detail) BOOST_TEMPLATED_STREAM_* macros
//
// Provides workaround platforms without stream class templates.
//
#if !defined(BOOST_NO_STD_LOCALE)
#define BOOST_TEMPLATED_STREAM_TEMPLATE(E,T) \
template < typename E , typename T >
#define BOOST_TEMPLATED_STREAM_TEMPLATE_ALLOC(E,T,A) \
template < typename E , typename T , typename A >
#define BOOST_TEMPLATED_STREAM_ARGS(E,T) \
typename E , typename T
#define BOOST_TEMPLATED_STREAM_ARGS_ALLOC(E,T,A) \
typename E , typename T , typename A
#define BOOST_TEMPLATED_STREAM_COMMA ,
#define BOOST_TEMPLATED_STREAM_ELEM(E) E
#define BOOST_TEMPLATED_STREAM_TRAITS(T) T
#define BOOST_TEMPLATED_STREAM_ALLOC(A) A
#define BOOST_TEMPLATED_STREAM(X,E,T) \
BOOST_JOIN(std::basic_,X)< E , T >
#define BOOST_TEMPLATED_STREAM_WITH_ALLOC(X,E,T,A) \
BOOST_JOIN(std::basic_,X)< E , T , A >
#else // defined(BOOST_NO_STD_LOCALE)
#define BOOST_TEMPLATED_STREAM_TEMPLATE(E,T) /**/
#define BOOST_TEMPLATED_STREAM_TEMPLATE_ALLOC(E,T,A) /**/
#define BOOST_TEMPLATED_STREAM_ARGS(E,T) /**/
#define BOOST_TEMPLATED_STREAM_ARGS_ALLOC(E,T,A) /**/
#define BOOST_TEMPLATED_STREAM_COMMA /**/
#define BOOST_TEMPLATED_STREAM_ELEM(E) char
#define BOOST_TEMPLATED_STREAM_TRAITS(T) std::char_traits<char>
#define BOOST_TEMPLATED_STREAM_ALLOC(A) std::allocator<char>
#define BOOST_TEMPLATED_STREAM(X,E,T) \
std::X
#define BOOST_TEMPLATED_STREAM_WITH_ALLOC(X,E,T,A) \
std::X
#endif // BOOST_NO_STD_LOCALE
#endif // BOOST_DETAIL_TEMPLATED_STREAMS_HPP
@@ -0,0 +1,216 @@
// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu)
// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu).
// Distributed under the Boost Software License, Version 1.0. (See accompany-
// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_UTF8_CODECVT_FACET_HPP
#define BOOST_UTF8_CODECVT_FACET_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// utf8_codecvt_facet.hpp
// This header defines class utf8_codecvt_facet, derived from
// std::codecvt<wchar_t, char>, which can be used to convert utf8 data in
// files into wchar_t strings in the application.
//
// The header is NOT STANDALONE, and is not to be included by the USER.
// There are at least two libraries which want to use this functionality, and
// we want to avoid code duplication. It would be possible to create utf8
// library, but:
// - this requires review process first
// - in the case, when linking the a library which uses utf8
// (say 'program_options'), user should also link to the utf8 library.
// This seems inconvenient, and asking a user to link to an unrevieved
// library is strange.
// Until the above points are fixed, a library which wants to use utf8 must:
// - include this header in one of it's headers or sources
// - include the corresponding boost/detail/utf8_codecvt_facet.ipp file in one
// of its sources
// - before including either file, the library must define
// - BOOST_UTF8_BEGIN_NAMESPACE to the namespace declaration that must be used
// - BOOST_UTF8_END_NAMESPACE to the code to close the previous namespace
// declaration.
// - BOOST_UTF8_DECL -- to the code which must be used for all 'exportable'
// symbols.
//
// For example, program_options library might contain:
// #define BOOST_UTF8_BEGIN_NAMESPACE <backslash character>
// namespace boost { namespace program_options {
// #define BOOST_UTF8_END_NAMESPACE }}
// #define BOOST_UTF8_DECL BOOST_PROGRAM_OPTIONS_DECL
// #include <boost/detail/utf8_codecvt_facet.ipp>
//
// Essentially, each library will have its own copy of utf8 code, in
// different namespaces.
// Note:(Robert Ramey). I have made the following alterations in the original
// code.
// a) Rendered utf8_codecvt<wchar_t, char> with using templates
// b) Move longer functions outside class definition to prevent inlining
// and make code smaller
// c) added on a derived class to permit translation to/from current
// locale to utf8
// See http://www.boost.org for updates, documentation, and revision history.
// archives stored as text - note these ar templated on the basic
// stream templates to accommodate wide (and other?) kind of characters
//
// note the fact that on libraries without wide characters, ostream is
// is not a specialization of basic_ostream which in fact is not defined
// in such cases. So we can't use basic_ostream<OStream::char_type> but rather
// use two template parameters
//
// utf8_codecvt_facet
// This is an implementation of a std::codecvt facet for translating
// from UTF-8 externally to UCS-4. Note that this is not tied to
// any specific types in order to allow customization on platforms
// where wchar_t is not big enough.
//
// NOTES: The current implementation jumps through some unpleasant hoops in
// order to deal with signed character types. As a std::codecvt_base::result,
// it is necessary for the ExternType to be convertible to unsigned char.
// I chose not to tie the extern_type explicitly to char. But if any combination
// of types other than <wchar_t,char_t> is used, then std::codecvt must be
// specialized on those types for this to work.
#include <locale>
#include <cwchar> // for mbstate_t
#include <cstddef> // for std::size_t
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std {
using ::mbstate_t;
using ::size_t;
}
#endif
// maximum lenght of a multibyte string
#define MB_LENGTH_MAX 8
BOOST_UTF8_BEGIN_NAMESPACE
//----------------------------------------------------------------------------//
// //
// utf8_codecvt_facet //
// //
// See utf8_codecvt_facet.ipp for the implementation. //
//----------------------------------------------------------------------------//
#ifndef BOOST_UTF8_DECL
#define BOOST_UTF8_DECL
#endif
struct BOOST_SYMBOL_VISIBLE utf8_codecvt_facet :
public std::codecvt<wchar_t, char, std::mbstate_t>
{
public:
BOOST_UTF8_DECL explicit utf8_codecvt_facet(std::size_t no_locale_manage=0);
virtual ~utf8_codecvt_facet(){}
protected:
BOOST_UTF8_DECL virtual std::codecvt_base::result do_in(
std::mbstate_t& state,
const char * from,
const char * from_end,
const char * & from_next,
wchar_t * to,
wchar_t * to_end,
wchar_t*& to_next
) const;
BOOST_UTF8_DECL 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
) const;
bool invalid_continuing_octet(unsigned char octet_1) const {
return (octet_1 < 0x80|| 0xbf< octet_1);
}
bool invalid_leading_octet(unsigned char octet_1) const {
return (0x7f < octet_1 && octet_1 < 0xc0) ||
(octet_1 > 0xfd);
}
// continuing octets = octets except for the leading octet
static unsigned int get_cont_octet_count(unsigned char lead_octet) {
return get_octet_count(lead_octet) - 1;
}
BOOST_UTF8_DECL static unsigned int get_octet_count(unsigned char lead_octet);
// How many "continuing octets" will be needed for this word
// == total octets - 1.
BOOST_UTF8_DECL int get_cont_octet_out_count(wchar_t word) const ;
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(
std::mbstate_t&,
char * from,
char * /*to*/,
char * & next
) const {
next = from;
return ok;
}
virtual int do_encoding() const BOOST_NOEXCEPT_OR_NOTHROW {
const int variable_byte_external_encoding=0;
return variable_byte_external_encoding;
}
// How many char objects can I process to get <= max_limit
// wchar_t objects?
BOOST_UTF8_DECL virtual int do_length(
const std::mbstate_t &,
const char * from,
const char * from_end,
std::size_t max_limit
) const
#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
throw()
#endif
;
virtual int do_length(
std::mbstate_t & s,
const char * from,
const char * from_end,
std::size_t max_limit
) const
#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
throw()
#endif
{
return do_length(
const_cast<const std::mbstate_t &>(s),
from,
from_end,
max_limit
);
}
// Largest possible value do_length(state,from,from_end,1) could return.
virtual int do_max_length() const BOOST_NOEXCEPT_OR_NOTHROW {
return 6; // largest UTF-8 encoding of a UCS-4 character
}
};
BOOST_UTF8_END_NAMESPACE
#endif // BOOST_UTF8_CODECVT_FACET_HPP
@@ -0,0 +1,289 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// utf8_codecvt_facet.ipp
// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu)
// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu).
// Use, modification and distribution is subject to 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)
// Please see the comments in <boost/detail/utf8_codecvt_facet.hpp> to
// learn how this file should be used.
#include <boost/detail/utf8_codecvt_facet.hpp>
#include <cstdlib> // for multi-byte converson routines
#include <cassert>
#include <boost/limits.hpp>
#include <boost/config.hpp>
// If we don't have wstring, then Unicode support
// is not available anyway, so we don't need to even
// compiler this file. This also fixes the problem
// with mingw, which can compile this file, but will
// generate link error when building DLL.
#ifndef BOOST_NO_STD_WSTRING
BOOST_UTF8_BEGIN_NAMESPACE
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// implementation for wchar_t
BOOST_UTF8_DECL utf8_codecvt_facet::utf8_codecvt_facet(
std::size_t no_locale_manage
) :
std::codecvt<wchar_t, char, std::mbstate_t>(no_locale_manage)
{}
// Translate incoming UTF-8 into UCS-4
BOOST_UTF8_DECL std::codecvt_base::result utf8_codecvt_facet::do_in(
std::mbstate_t& /*state*/,
const char * from,
const char * from_end,
const char * & from_next,
wchar_t * to,
wchar_t * to_end,
wchar_t * & to_next
) const {
// Basic algorithm: The first octet determines how many
// octets total make up the UCS-4 character. The remaining
// "continuing octets" all begin with "10". To convert, subtract
// the amount that specifies the number of octets from the first
// octet. Subtract 0x80 (1000 0000) from each continuing octet,
// then mash the whole lot together. Note that each continuing
// octet only uses 6 bits as unique values, so only shift by
// multiples of 6 to combine.
while (from != from_end && to != to_end) {
// Error checking on the first octet
if (invalid_leading_octet(*from)){
from_next = from;
to_next = to;
return std::codecvt_base::error;
}
// The first octet is adjusted by a value dependent upon
// the number of "continuing octets" encoding the character
const int cont_octet_count = get_cont_octet_count(*from);
const wchar_t octet1_modifier_table[] = {
0x00, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc
};
// The unsigned char conversion is necessary in case char is
// signed (I learned this the hard way)
wchar_t ucs_result =
(unsigned char)(*from++) - octet1_modifier_table[cont_octet_count];
// Invariants :
// 1) At the start of the loop, 'i' continuing characters have been
// processed
// 2) *from points to the next continuing character to be processed.
int i = 0;
while(i != cont_octet_count && from != from_end) {
// Error checking on continuing characters
if (invalid_continuing_octet(*from)) {
from_next = from;
to_next = to;
return std::codecvt_base::error;
}
ucs_result *= (1 << 6);
// each continuing character has an extra (10xxxxxx)b attached to
// it that must be removed.
ucs_result += (unsigned char)(*from++) - 0x80;
++i;
}
// If the buffer ends with an incomplete unicode character...
if (from == from_end && i != cont_octet_count) {
// rewind "from" to before the current character translation
from_next = from - (i+1);
to_next = to;
return std::codecvt_base::partial;
}
*to++ = ucs_result;
}
from_next = from;
to_next = to;
// Were we done converting or did we run out of destination space?
if(from == from_end) return std::codecvt_base::ok;
else return std::codecvt_base::partial;
}
BOOST_UTF8_DECL std::codecvt_base::result utf8_codecvt_facet::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
) const
{
// RG - consider merging this table with the other one
const wchar_t octet1_modifier_table[] = {
0x00, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc
};
wchar_t max_wchar = (std::numeric_limits<wchar_t>::max)();
while (from != from_end && to != to_end) {
// Check for invalid UCS-4 character
if (*from > max_wchar) {
from_next = from;
to_next = to;
return std::codecvt_base::error;
}
int cont_octet_count = get_cont_octet_out_count(*from);
// RG - comment this formula better
int shift_exponent = (cont_octet_count) * 6;
// Process the first character
*to++ = static_cast<char>(octet1_modifier_table[cont_octet_count] +
(unsigned char)(*from / (1 << shift_exponent)));
// Process the continuation characters
// Invariants: At the start of the loop:
// 1) 'i' continuing octets have been generated
// 2) '*to' points to the next location to place an octet
// 3) shift_exponent is 6 more than needed for the next octet
int i = 0;
while (i != cont_octet_count && to != to_end) {
shift_exponent -= 6;
*to++ = static_cast<char>(0x80 + ((*from / (1 << shift_exponent)) % (1 << 6)));
++i;
}
// If we filled up the out buffer before encoding the character
if(to == to_end && i != cont_octet_count) {
from_next = from;
to_next = to - (i+1);
return std::codecvt_base::partial;
}
++from;
}
from_next = from;
to_next = to;
// Were we done or did we run out of destination space
if(from == from_end) return std::codecvt_base::ok;
else return std::codecvt_base::partial;
}
// How many char objects can I process to get <= max_limit
// wchar_t objects?
BOOST_UTF8_DECL int utf8_codecvt_facet::do_length(
const std::mbstate_t &,
const char * from,
const char * from_end,
std::size_t max_limit
) const
#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
throw()
#endif
{
// RG - this code is confusing! I need a better way to express it.
// and test cases.
// Invariants:
// 1) last_octet_count has the size of the last measured character
// 2) char_count holds the number of characters shown to fit
// within the bounds so far (no greater than max_limit)
// 3) from_next points to the octet 'last_octet_count' before the
// last measured character.
int last_octet_count=0;
std::size_t char_count = 0;
const char* from_next = from;
// Use "<" because the buffer may represent incomplete characters
while (from_next+last_octet_count <= from_end && char_count <= max_limit) {
from_next += last_octet_count;
last_octet_count = (get_octet_count(*from_next));
++char_count;
}
return static_cast<int>(from_next-from);
}
BOOST_UTF8_DECL unsigned int utf8_codecvt_facet::get_octet_count(
unsigned char lead_octet
){
// if the 0-bit (MSB) is 0, then 1 character
if (lead_octet <= 0x7f) return 1;
// Otherwise the count number of consecutive 1 bits starting at MSB
// assert(0xc0 <= lead_octet && lead_octet <= 0xfd);
if (0xc0 <= lead_octet && lead_octet <= 0xdf) return 2;
else if (0xe0 <= lead_octet && lead_octet <= 0xef) return 3;
else if (0xf0 <= lead_octet && lead_octet <= 0xf7) return 4;
else if (0xf8 <= lead_octet && lead_octet <= 0xfb) return 5;
else return 6;
}
namespace detail {
template<std::size_t s>
int get_cont_octet_out_count_impl(wchar_t word){
if (word < 0x80) {
return 0;
}
if (word < 0x800) {
return 1;
}
return 2;
}
template<>
int get_cont_octet_out_count_impl<4>(wchar_t word){
if (word < 0x80) {
return 0;
}
if (word < 0x800) {
return 1;
}
// Note that the following code will generate warnings on some platforms
// where wchar_t is defined as UCS2. The warnings are superfluous as the
// specialization is never instantitiated with such compilers, but this
// can cause problems if warnings are being treated as errors, so we guard
// against that. Including <boost/detail/utf8_codecvt_facet.hpp> as we do
// should be enough to get WCHAR_MAX defined.
#if !defined(WCHAR_MAX)
# error WCHAR_MAX not defined!
#endif
// cope with VC++ 7.1 or earlier having invalid WCHAR_MAX
#if defined(_MSC_VER) && _MSC_VER <= 1310 // 7.1 or earlier
return 2;
#elif WCHAR_MAX > 0x10000
if (word < 0x10000) {
return 2;
}
if (word < 0x200000) {
return 3;
}
if (word < 0x4000000) {
return 4;
}
return 5;
#else
return 2;
#endif
}
} // namespace detail
// How many "continuing octets" will be needed for this word
// == total octets - 1.
BOOST_UTF8_DECL int utf8_codecvt_facet::get_cont_octet_out_count(
wchar_t word
) const {
return detail::get_cont_octet_out_count_impl<sizeof(wchar_t)>(word);
}
BOOST_UTF8_END_NAMESPACE
#endif
@@ -0,0 +1,25 @@
// GetCurrentProcess.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP
#define BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP
#include <boost/detail/winapi/get_current_process.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if defined(__GNUC__) && (((__GNUC__*100)+__GNUC_MINOR__) > 403)
#pragma message "This header is deprecated, use boost/detail/winapi/get_current_process.hpp instead."
#elif defined(_MSC_VER)
#pragma message("This header is deprecated, use boost/detail/winapi/get_current_process.hpp instead.")
#endif
#endif // BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP
@@ -0,0 +1,25 @@
// GetCurrentThread.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP
#define BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP
#include <boost/detail/winapi/get_current_thread.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if defined(__GNUC__) && (((__GNUC__*100)+__GNUC_MINOR__) > 403)
#pragma message "This header is deprecated, use boost/detail/winapi/get_current_thread.hpp instead."
#elif defined(_MSC_VER)
#pragma message("This header is deprecated, use boost/detail/winapi/get_current_thread.hpp instead.")
#endif
#endif // BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP
@@ -0,0 +1,25 @@
// GetLastError.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_GETLASTERROR_HPP
#define BOOST_DETAIL_WINAPI_GETLASTERROR_HPP
#include <boost/detail/winapi/get_last_error.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if defined(__GNUC__) && (((__GNUC__*100)+__GNUC_MINOR__) > 403)
#pragma message "This header is deprecated, use boost/detail/winapi/get_last_error.hpp instead."
#elif defined(_MSC_VER)
#pragma message("This header is deprecated, use boost/detail/winapi/get_last_error.hpp instead.")
#endif
#endif // BOOST_DETAIL_WINAPI_GETLASTERROR_HPP
@@ -0,0 +1,24 @@
// GetProcessTimes.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP
#define BOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP
#include <boost/detail/winapi/get_process_times.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if defined(__GNUC__) && (((__GNUC__*100)+__GNUC_MINOR__) > 403)
#pragma message "This header is deprecated, use boost/detail/winapi/get_process_times.hpp instead."
#elif defined(_MSC_VER)
#pragma message("This header is deprecated, use boost/detail/winapi/get_process_times.hpp instead.")
#endif
#endif // BOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP
@@ -0,0 +1,25 @@
// GetThreadTimes.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP
#define BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP
#include <boost/detail/winapi/get_thread_times.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if defined(__GNUC__) && (((__GNUC__*100)+__GNUC_MINOR__) > 403)
#pragma message "This header is deprecated, use boost/detail/winapi/get_thread_times.hpp instead."
#elif defined(_MSC_VER)
#pragma message("This header is deprecated, use boost/detail/winapi/get_thread_times.hpp instead.")
#endif
#endif // BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP
@@ -0,0 +1,84 @@
// access_rights.hpp --------------------------------------------------------------//
// Copyright 2016 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_ACCESS_RIGHTS_HPP
#define BOOST_DETAIL_WINAPI_ACCESS_RIGHTS_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 )
const DWORD_ DELETE_ = DELETE;
const DWORD_ READ_CONTROL_ = READ_CONTROL;
const DWORD_ WRITE_DAC_ = WRITE_DAC;
const DWORD_ WRITE_OWNER_ = WRITE_OWNER;
const DWORD_ SYNCHRONIZE_ = SYNCHRONIZE;
const DWORD_ STANDARD_RIGHTS_ALL_ = STANDARD_RIGHTS_ALL;
const DWORD_ STANDARD_RIGHTS_EXECUTE_ = STANDARD_RIGHTS_EXECUTE;
const DWORD_ STANDARD_RIGHTS_READ_ = STANDARD_RIGHTS_READ;
const DWORD_ STANDARD_RIGHTS_REQUIRED_ = STANDARD_RIGHTS_REQUIRED;
const DWORD_ STANDARD_RIGHTS_WRITE_ = STANDARD_RIGHTS_WRITE;
const DWORD_ SPECIFIC_RIGHTS_ALL_ = SPECIFIC_RIGHTS_ALL;
const DWORD_ ACCESS_SYSTEM_SECURITY_ = ACCESS_SYSTEM_SECURITY;
const DWORD_ MAXIMUM_ALLOWED_ = MAXIMUM_ALLOWED;
const DWORD_ GENERIC_ALL_ = GENERIC_ALL;
const DWORD_ GENERIC_EXECUTE_ = GENERIC_EXECUTE;
const DWORD_ GENERIC_WRITE_ = GENERIC_WRITE;
const DWORD_ GENERIC_READ_ = GENERIC_READ;
typedef ::ACCESS_MASK ACCESS_MASK_;
typedef ::PACCESS_MASK PACCESS_MASK_;
#else // defined( BOOST_USE_WINDOWS_H )
const DWORD_ DELETE_ = 0x00010000;
const DWORD_ READ_CONTROL_ = 0x00020000;
const DWORD_ WRITE_DAC_ = 0x00040000;
const DWORD_ WRITE_OWNER_ = 0x00080000;
const DWORD_ SYNCHRONIZE_ = 0x00100000;
const DWORD_ STANDARD_RIGHTS_ALL_ = 0x001F0000;
const DWORD_ STANDARD_RIGHTS_EXECUTE_ = READ_CONTROL_;
const DWORD_ STANDARD_RIGHTS_READ_ = READ_CONTROL_;
const DWORD_ STANDARD_RIGHTS_REQUIRED_ = 0x000F0000;
const DWORD_ STANDARD_RIGHTS_WRITE_ = READ_CONTROL_;
const DWORD_ SPECIFIC_RIGHTS_ALL_ = 0x0000FFFF;
const DWORD_ ACCESS_SYSTEM_SECURITY_ = 0x01000000;
const DWORD_ MAXIMUM_ALLOWED_ = 0x02000000;
const DWORD_ GENERIC_ALL_ = 0x10000000;
const DWORD_ GENERIC_EXECUTE_ = 0x20000000;
const DWORD_ GENERIC_WRITE_ = 0x40000000;
const DWORD_ GENERIC_READ_ = 0x80000000;
typedef DWORD_ ACCESS_MASK_;
typedef ACCESS_MASK_* PACCESS_MASK_;
#endif // defined( BOOST_USE_WINDOWS_H )
}
}
}
#endif // BOOST_DETAIL_WINAPI_ACCESS_RIGHTS_HPP
@@ -0,0 +1,47 @@
// apc.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_APC_HPP
#define BOOST_DETAIL_WINAPI_APC_HPP
#include <boost/detail/winapi/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4
#include <boost/detail/winapi/basic_types.hpp>
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
typedef boost::detail::winapi::VOID_
(NTAPI *PAPCFUNC)(boost::detail::winapi::ULONG_PTR_ Parameter);
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
QueueUserAPC(
PAPCFUNC pfnAPC,
boost::detail::winapi::HANDLE_ hThread,
boost::detail::winapi::ULONG_PTR_ dwData);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
typedef ::PAPCFUNC PAPCFUNC_;
using ::QueueUserAPC;
}
}
}
#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4
#endif // BOOST_DETAIL_WINAPI_APC_HPP
@@ -0,0 +1,233 @@
// basic_types.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_BASIC_TYPES_HPP
#define BOOST_DETAIL_WINAPI_BASIC_TYPES_HPP
#include <cstdarg>
#include <boost/cstdint.hpp>
#include <boost/detail/winapi/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if defined( BOOST_USE_WINDOWS_H )
# include <windows.h>
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined(__CYGWIN__)
# include <winerror.h>
# ifdef UNDER_CE
# ifndef WINAPI
# ifndef _WIN32_WCE_EMULATION
# define WINAPI __cdecl // Note this doesn't match the desktop definition
# else
# define WINAPI __stdcall
# endif
# endif
// Windows CE defines a few functions as inline functions in kfuncs.h
typedef int BOOL;
typedef unsigned long DWORD;
typedef void* HANDLE;
# include <kfuncs.h>
# else
# ifndef WINAPI
# define WINAPI __stdcall
# endif
# endif
# ifndef NTAPI
# define NTAPI __stdcall
# endif
#else
# error "Win32 functions not available"
#endif
#ifndef NO_STRICT
#ifndef STRICT
#define STRICT 1
#endif
#endif
#if defined(STRICT)
#define BOOST_DETAIL_WINAPI_DECLARE_HANDLE(x) struct x##__; typedef struct x##__ *x
#else
#define BOOST_DETAIL_WINAPI_DECLARE_HANDLE(x) typedef void* x
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
union _LARGE_INTEGER;
struct _SECURITY_ATTRIBUTES;
BOOST_DETAIL_WINAPI_DECLARE_HANDLE(HINSTANCE);
typedef HINSTANCE HMODULE;
}
#endif
#if defined(__GNUC__)
#define BOOST_DETAIL_WINAPI_MAY_ALIAS __attribute__ ((__may_alias__))
#else
#define BOOST_DETAIL_WINAPI_MAY_ALIAS
#endif
// MinGW64 gcc 4.8.2 fails to compile function declarations with boost::detail::winapi::VOID_ arguments even though
// the typedef expands to void. In Windows SDK, VOID is a macro which unfolds to void. We use our own macro in such cases.
#define BOOST_DETAIL_WINAPI_VOID void
namespace boost {
namespace detail {
namespace winapi {
#if defined( BOOST_USE_WINDOWS_H )
typedef ::BOOL BOOL_;
typedef ::PBOOL PBOOL_;
typedef ::LPBOOL LPBOOL_;
typedef ::BOOLEAN BOOLEAN_;
typedef ::PBOOLEAN PBOOLEAN_;
typedef ::BYTE BYTE_;
typedef ::PBYTE PBYTE_;
typedef ::LPBYTE LPBYTE_;
typedef ::WORD WORD_;
typedef ::PWORD PWORD_;
typedef ::LPWORD LPWORD_;
typedef ::DWORD DWORD_;
typedef ::PDWORD PDWORD_;
typedef ::LPDWORD LPDWORD_;
typedef ::HANDLE HANDLE_;
typedef ::PHANDLE PHANDLE_;
typedef ::SHORT SHORT_;
typedef ::PSHORT PSHORT_;
typedef ::USHORT USHORT_;
typedef ::PUSHORT PUSHORT_;
typedef ::INT INT_;
typedef ::PINT PINT_;
typedef ::LPINT LPINT_;
typedef ::UINT UINT_;
typedef ::PUINT PUINT_;
typedef ::LONG LONG_;
typedef ::PLONG PLONG_;
typedef ::LPLONG LPLONG_;
typedef ::ULONG ULONG_;
typedef ::PULONG PULONG_;
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 ::DWORD_PTR DWORD_PTR_;
typedef ::PDWORD_PTR PDWORD_PTR_;
typedef ::SIZE_T SIZE_T_;
typedef ::PSIZE_T PSIZE_T_;
typedef ::SSIZE_T SSIZE_T_;
typedef ::PSSIZE_T PSSIZE_T_;
typedef VOID VOID_; // VOID is a macro
typedef ::PVOID PVOID_;
typedef ::LPVOID LPVOID_;
typedef ::LPCVOID LPCVOID_;
typedef ::CHAR CHAR_;
typedef ::LPSTR LPSTR_;
typedef ::LPCSTR LPCSTR_;
typedef ::WCHAR WCHAR_;
typedef ::LPWSTR LPWSTR_;
typedef ::LPCWSTR LPCWSTR_;
#else // defined( BOOST_USE_WINDOWS_H )
typedef int BOOL_;
typedef BOOL_* PBOOL_;
typedef BOOL_* LPBOOL_;
typedef unsigned char BYTE_;
typedef BYTE_* PBYTE_;
typedef BYTE_* LPBYTE_;
typedef BYTE_ BOOLEAN_;
typedef BOOLEAN_* PBOOLEAN_;
typedef unsigned short WORD_;
typedef WORD_* PWORD_;
typedef WORD_* LPWORD_;
typedef unsigned long DWORD_;
typedef DWORD_* PDWORD_;
typedef DWORD_* LPDWORD_;
typedef void* HANDLE_;
typedef void** PHANDLE_;
typedef short SHORT_;
typedef SHORT_* PSHORT_;
typedef unsigned short USHORT_;
typedef USHORT_* PUSHORT_;
typedef int INT_;
typedef INT_* PINT_;
typedef INT_* LPINT_;
typedef unsigned int UINT_;
typedef UINT_* PUINT_;
typedef long LONG_;
typedef LONG_* PLONG_;
typedef LONG_* LPLONG_;
typedef unsigned long ULONG_;
typedef ULONG_* PULONG_;
typedef boost::int64_t LONGLONG_;
typedef boost::uint64_t ULONGLONG_;
# 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
typedef ULONG_PTR_ DWORD_PTR_, *PDWORD_PTR_;
typedef ULONG_PTR_ SIZE_T_, *PSIZE_T_;
typedef LONG_PTR_ SSIZE_T_, *PSSIZE_T_;
typedef void VOID_;
typedef void *PVOID_;
typedef void *LPVOID_;
typedef const void *LPCVOID_;
typedef char CHAR_;
typedef CHAR_ *LPSTR_;
typedef const CHAR_ *LPCSTR_;
typedef wchar_t WCHAR_;
typedef WCHAR_ *LPWSTR_;
typedef const WCHAR_ *LPCWSTR_;
#endif // defined( BOOST_USE_WINDOWS_H )
typedef ::HMODULE HMODULE_;
typedef union BOOST_DETAIL_WINAPI_MAY_ALIAS _LARGE_INTEGER {
struct {
DWORD_ LowPart;
LONG_ HighPart;
} u;
LONGLONG_ QuadPart;
} LARGE_INTEGER_, *PLARGE_INTEGER_;
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _SECURITY_ATTRIBUTES {
DWORD_ nLength;
LPVOID_ lpSecurityDescriptor;
BOOL_ bInheritHandle;
} SECURITY_ATTRIBUTES_, *PSECURITY_ATTRIBUTES_, *LPSECURITY_ATTRIBUTES_;
}
}
}
#endif // BOOST_DETAIL_WINAPI_BASIC_TYPES_HPP
@@ -0,0 +1,108 @@
// character_code_conversion.hpp --------------------------------------------------------------//
// Copyright 2016 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_CHARACTER_CODE_CONVERSION_HPP
#define BOOST_DETAIL_WINAPI_CHARACTER_CODE_CONVERSION_HPP
#include <boost/detail/winapi/basic_types.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
BOOST_SYMBOL_IMPORT int WINAPI
MultiByteToWideChar(
boost::detail::winapi::UINT_ CodePage,
boost::detail::winapi::DWORD_ dwFlags,
boost::detail::winapi::LPCSTR_ lpMultiByteStr,
int cbMultiByte,
boost::detail::winapi::LPWSTR_ lpWideCharStr,
int cchWideChar);
BOOST_SYMBOL_IMPORT int WINAPI
WideCharToMultiByte(
boost::detail::winapi::UINT_ CodePage,
boost::detail::winapi::DWORD_ dwFlags,
boost::detail::winapi::LPCWSTR_ lpWideCharStr,
int cchWideChar,
boost::detail::winapi::LPSTR_ lpMultiByteStr,
int cbMultiByte,
boost::detail::winapi::LPCSTR_ lpDefaultChar,
boost::detail::winapi::LPBOOL_ lpUsedDefaultChar);
} // extern "C"
#endif // #if !defined( BOOST_USE_WINDOWS_H )
namespace boost {
namespace detail {
namespace winapi {
#if defined( BOOST_USE_WINDOWS_H )
const UINT_ CP_ACP_ = CP_ACP;
const UINT_ CP_OEMCP_ = CP_OEMCP;
const UINT_ CP_MACCP_ = CP_MACCP;
const UINT_ CP_THREAD_ACP_ = CP_THREAD_ACP;
const UINT_ CP_SYMBOL_ = CP_SYMBOL;
const UINT_ CP_UTF7_ = CP_UTF7;
const UINT_ CP_UTF8_ = CP_UTF8;
const DWORD_ MB_PRECOMPOSED_ = MB_PRECOMPOSED;
const DWORD_ MB_COMPOSITE_ = MB_COMPOSITE;
const DWORD_ MB_USEGLYPHCHARS_ = MB_USEGLYPHCHARS;
const DWORD_ MB_ERR_INVALID_CHARS_ = MB_ERR_INVALID_CHARS;
const DWORD_ WC_COMPOSITECHECK_ = WC_COMPOSITECHECK;
const DWORD_ WC_DISCARDNS_ = WC_DISCARDNS;
const DWORD_ WC_SEPCHARS_ = WC_SEPCHARS;
const DWORD_ WC_DEFAULTCHAR_ = WC_DEFAULTCHAR;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN2K
const DWORD_ WC_NO_BEST_FIT_CHARS_ = WC_NO_BEST_FIT_CHARS;
#endif
#else // defined( BOOST_USE_WINDOWS_H )
const UINT_ CP_ACP_ = 0u;
const UINT_ CP_OEMCP_ = 1u;
const UINT_ CP_MACCP_ = 2u;
const UINT_ CP_THREAD_ACP_ = 3u;
const UINT_ CP_SYMBOL_ = 42u;
const UINT_ CP_UTF7_ = 65000u;
const UINT_ CP_UTF8_ = 65001u;
const DWORD_ MB_PRECOMPOSED_ = 0x00000001;
const DWORD_ MB_COMPOSITE_ = 0x00000002;
const DWORD_ MB_USEGLYPHCHARS_ = 0x00000004;
const DWORD_ MB_ERR_INVALID_CHARS_ = 0x00000008;
const DWORD_ WC_COMPOSITECHECK_ = 0x00000200;
const DWORD_ WC_DISCARDNS_ = 0x00000010;
const DWORD_ WC_SEPCHARS_ = 0x00000020;
const DWORD_ WC_DEFAULTCHAR_ = 0x00000040;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN2K
const DWORD_ WC_NO_BEST_FIT_CHARS_ = 0x00000400;
#endif
#endif // defined( BOOST_USE_WINDOWS_H )
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
// This constant is not present in MinGW
const DWORD_ WC_ERR_INVALID_CHARS_ = 0x00000080;
#endif
using ::MultiByteToWideChar;
using ::WideCharToMultiByte;
} // namespace winapi
} // namespace detail
} // namespace boost
#endif // BOOST_DETAIL_WINAPI_CHARACTER_CODE_CONVERSION_HPP
@@ -0,0 +1,123 @@
// condition_variable.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_CONDITION_VARIABLE_HPP
#define BOOST_DETAIL_WINAPI_CONDITION_VARIABLE_HPP
#include <boost/detail/winapi/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
#include <boost/detail/winapi/basic_types.hpp>
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
struct _RTL_CONDITION_VARIABLE;
struct _RTL_CRITICAL_SECTION;
struct _RTL_SRWLOCK;
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
InitializeConditionVariable(::_RTL_CONDITION_VARIABLE* ConditionVariable);
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
WakeConditionVariable(::_RTL_CONDITION_VARIABLE* ConditionVariable);
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
WakeAllConditionVariable(::_RTL_CONDITION_VARIABLE* ConditionVariable);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
SleepConditionVariableCS(
::_RTL_CONDITION_VARIABLE* ConditionVariable,
::_RTL_CRITICAL_SECTION* CriticalSection,
boost::detail::winapi::DWORD_ dwMilliseconds);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
SleepConditionVariableSRW(
::_RTL_CONDITION_VARIABLE* ConditionVariable,
::_RTL_SRWLOCK* SRWLock,
boost::detail::winapi::DWORD_ dwMilliseconds,
boost::detail::winapi::ULONG_ Flags);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _RTL_CONDITION_VARIABLE {
PVOID_ Ptr;
} CONDITION_VARIABLE_, *PCONDITION_VARIABLE_;
#if defined( BOOST_USE_WINDOWS_H )
#define BOOST_DETAIL_WINAPI_CONDITION_VARIABLE_INIT CONDITION_VARIABLE_INIT
#else
#define BOOST_DETAIL_WINAPI_CONDITION_VARIABLE {0}
#endif
struct _RTL_CRITICAL_SECTION;
struct _RTL_SRWLOCK;
BOOST_FORCEINLINE VOID_ InitializeConditionVariable(PCONDITION_VARIABLE_ ConditionVariable)
{
::InitializeConditionVariable(reinterpret_cast< ::_RTL_CONDITION_VARIABLE* >(ConditionVariable));
}
BOOST_FORCEINLINE VOID_ WakeConditionVariable(PCONDITION_VARIABLE_ ConditionVariable)
{
::WakeConditionVariable(reinterpret_cast< ::_RTL_CONDITION_VARIABLE* >(ConditionVariable));
}
BOOST_FORCEINLINE VOID_ WakeAllConditionVariable(PCONDITION_VARIABLE_ ConditionVariable)
{
::WakeAllConditionVariable(reinterpret_cast< ::_RTL_CONDITION_VARIABLE* >(ConditionVariable));
}
BOOST_FORCEINLINE BOOL_ SleepConditionVariableCS(
PCONDITION_VARIABLE_ ConditionVariable,
_RTL_CRITICAL_SECTION* CriticalSection,
DWORD_ dwMilliseconds)
{
return ::SleepConditionVariableCS(
reinterpret_cast< ::_RTL_CONDITION_VARIABLE* >(ConditionVariable),
reinterpret_cast< ::_RTL_CRITICAL_SECTION* >(CriticalSection),
dwMilliseconds);
}
BOOST_FORCEINLINE BOOL_ SleepConditionVariableSRW(
PCONDITION_VARIABLE_ ConditionVariable,
_RTL_SRWLOCK* SRWLock,
DWORD_ dwMilliseconds,
ULONG_ Flags)
{
return ::SleepConditionVariableSRW(
reinterpret_cast< ::_RTL_CONDITION_VARIABLE* >(ConditionVariable),
reinterpret_cast< ::_RTL_SRWLOCK* >(SRWLock),
dwMilliseconds,
Flags);
}
#if defined( BOOST_USE_WINDOWS_H )
const ULONG_ CONDITION_VARIABLE_LOCKMODE_SHARED_ = CONDITION_VARIABLE_LOCKMODE_SHARED;
#else // defined( BOOST_USE_WINDOWS_H )
const ULONG_ CONDITION_VARIABLE_LOCKMODE_SHARED_ = 0x00000001;
#endif // defined( BOOST_USE_WINDOWS_H )
const ULONG_ condition_variable_lockmode_shared = CONDITION_VARIABLE_LOCKMODE_SHARED_;
}
}
}
#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
#endif // BOOST_DETAIL_WINAPI_CONDITION_VARIABLE_HPP
@@ -0,0 +1,79 @@
// 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_
#if defined __MINGW32__
#include <_mingw.h>
#endif
// BOOST_WINAPI_IS_MINGW indicates that the target Windows SDK is provided by MinGW (http://mingw.org/).
// BOOST_WINAPI_IS_MINGW_W64 indicates that the target Windows SDK is provided by MinGW-w64 (http://mingw-w64.org).
#if defined __MINGW32__
#if defined __MINGW64_VERSION_MAJOR
#define BOOST_WINAPI_IS_MINGW_W64
#else
#define BOOST_WINAPI_IS_MINGW
#endif
#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
#define BOOST_WINAPI_VERSION_WINTHRESHOLD 0x0A00
#define BOOST_WINAPI_VERSION_WIN10 0x0A00
#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 Vista API on compilers that support it and XP on the others
#if (defined(_MSC_VER) && _MSC_VER < 1500) || defined(BOOST_WINAPI_IS_MINGW)
#define BOOST_USE_WINAPI_VERSION BOOST_WINAPI_VERSION_WINXP
#else
#define BOOST_USE_WINAPI_VERSION BOOST_WINAPI_VERSION_WIN6
#endif
#endif
#endif
#define BOOST_DETAIL_WINAPI_MAKE_NTDDI_VERSION2(x) x##0000
#define BOOST_DETAIL_WINAPI_MAKE_NTDDI_VERSION(x) BOOST_DETAIL_WINAPI_MAKE_NTDDI_VERSION2(x)
#if defined(BOOST_USE_WINDOWS_H) || defined(BOOST_WINAPI_DEFINE_VERSION_MACROS)
// 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
#if !defined(NTDDI_VERSION)
#define NTDDI_VERSION BOOST_DETAIL_WINAPI_MAKE_NTDDI_VERSION(BOOST_USE_WINAPI_VERSION)
#endif
#endif
#include <boost/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#endif // BOOST_DETAIL_WINAPI_CONFIG_HPP_INCLUDED_
@@ -0,0 +1,184 @@
// critical_section.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_CRITICAL_SECTION_HPP
#define BOOST_DETAIL_WINAPI_CRITICAL_SECTION_HPP
#include <boost/detail/winapi/basic_types.hpp>
#include <boost/detail/winapi/detail/cast_ptr.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
#if !defined( BOOST_WINAPI_IS_MINGW )
struct _RTL_CRITICAL_SECTION;
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
InitializeCriticalSection(::_RTL_CRITICAL_SECTION* lpCriticalSection);
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
EnterCriticalSection(::_RTL_CRITICAL_SECTION* lpCriticalSection);
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
LeaveCriticalSection(::_RTL_CRITICAL_SECTION* lpCriticalSection);
#if BOOST_USE_WINAPI_VERSION >= 0x0403
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
InitializeCriticalSectionAndSpinCount(
::_RTL_CRITICAL_SECTION* lpCriticalSection,
boost::detail::winapi::DWORD_ dwSpinCount);
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
InitializeCriticalSectionEx(
::_RTL_CRITICAL_SECTION* lpCriticalSection,
boost::detail::winapi::DWORD_ dwSpinCount,
boost::detail::winapi::DWORD_ Flags);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
SetCriticalSectionSpinCount(
::_RTL_CRITICAL_SECTION* lpCriticalSection,
boost::detail::winapi::DWORD_ dwSpinCount);
#endif
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
TryEnterCriticalSection(::_RTL_CRITICAL_SECTION* lpCriticalSection);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
DeleteCriticalSection(::_RTL_CRITICAL_SECTION* lpCriticalSection);
#else // defined( BOOST_WINAPI_IS_MINGW )
// MinGW uses a different name for the structure
struct _CRITICAL_SECTION;
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
InitializeCriticalSection(::_CRITICAL_SECTION* lpCriticalSection);
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
EnterCriticalSection(::_CRITICAL_SECTION* lpCriticalSection);
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
LeaveCriticalSection(::_CRITICAL_SECTION* lpCriticalSection);
#if BOOST_USE_WINAPI_VERSION >= 0x0403
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
InitializeCriticalSectionAndSpinCount(
::_CRITICAL_SECTION* lpCriticalSection,
boost::detail::winapi::DWORD_ dwSpinCount);
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
InitializeCriticalSectionEx(
::_CRITICAL_SECTION* lpCriticalSection,
boost::detail::winapi::DWORD_ dwSpinCount,
boost::detail::winapi::DWORD_ Flags);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
SetCriticalSectionSpinCount(
::_CRITICAL_SECTION* lpCriticalSection,
boost::detail::winapi::DWORD_ dwSpinCount);
#endif
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
TryEnterCriticalSection(::_CRITICAL_SECTION* lpCriticalSection);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
DeleteCriticalSection(::_CRITICAL_SECTION* lpCriticalSection);
#endif // defined( BOOST_WINAPI_IS_MINGW )
}
#endif
namespace boost {
namespace detail {
namespace winapi {
struct _RTL_CRITICAL_SECTION_DEBUG;
#pragma pack(push, 8)
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _RTL_CRITICAL_SECTION {
_RTL_CRITICAL_SECTION_DEBUG* DebugInfo;
LONG_ LockCount;
LONG_ RecursionCount;
HANDLE_ OwningThread;
HANDLE_ LockSemaphore;
ULONG_PTR_ SpinCount;
} CRITICAL_SECTION_, *PCRITICAL_SECTION_;
#pragma pack(pop)
BOOST_FORCEINLINE VOID_ InitializeCriticalSection(CRITICAL_SECTION_* lpCriticalSection)
{
::InitializeCriticalSection(winapi::detail::cast_ptr(lpCriticalSection));
}
BOOST_FORCEINLINE VOID_ EnterCriticalSection(CRITICAL_SECTION_* lpCriticalSection)
{
::EnterCriticalSection(winapi::detail::cast_ptr(lpCriticalSection));
}
BOOST_FORCEINLINE VOID_ LeaveCriticalSection(CRITICAL_SECTION_* lpCriticalSection)
{
::LeaveCriticalSection(winapi::detail::cast_ptr(lpCriticalSection));
}
#if BOOST_USE_WINAPI_VERSION >= 0x0403
BOOST_FORCEINLINE BOOL_ InitializeCriticalSectionAndSpinCount(CRITICAL_SECTION_* lpCriticalSection, DWORD_ dwSpinCount)
{
return ::InitializeCriticalSectionAndSpinCount(winapi::detail::cast_ptr(lpCriticalSection), dwSpinCount);
}
// CRITICAL_SECTION_NO_DEBUG_INFO is defined for WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
const DWORD_ CRITICAL_SECTION_NO_DEBUG_INFO_ = 0x01000000;
const DWORD_ CRITICAL_SECTION_FLAG_NO_DEBUG_INFO_ = CRITICAL_SECTION_NO_DEBUG_INFO_;
const DWORD_ CRITICAL_SECTION_FLAG_DYNAMIC_SPIN_ = 0x02000000; // undocumented
const DWORD_ CRITICAL_SECTION_FLAG_STATIC_INIT_ = 0x04000000; // undocumented
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
BOOST_FORCEINLINE BOOL_ InitializeCriticalSectionEx(CRITICAL_SECTION_* lpCriticalSection, DWORD_ dwSpinCount, DWORD_ Flags)
{
return ::InitializeCriticalSectionEx(winapi::detail::cast_ptr(lpCriticalSection), dwSpinCount, Flags);
}
#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
BOOST_FORCEINLINE DWORD_ SetCriticalSectionSpinCount(CRITICAL_SECTION_* lpCriticalSection, DWORD_ dwSpinCount)
{
return ::SetCriticalSectionSpinCount(winapi::detail::cast_ptr(lpCriticalSection), dwSpinCount);
}
#endif // BOOST_USE_WINAPI_VERSION >= 0x0403
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4
BOOST_FORCEINLINE BOOL_ TryEnterCriticalSection(CRITICAL_SECTION_* lpCriticalSection)
{
return ::TryEnterCriticalSection(winapi::detail::cast_ptr(lpCriticalSection));
}
#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4
BOOST_FORCEINLINE VOID_ DeleteCriticalSection(CRITICAL_SECTION_* lpCriticalSection)
{
::DeleteCriticalSection(winapi::detail::cast_ptr(lpCriticalSection));
}
}
}
}
#endif // BOOST_DETAIL_WINAPI_CRITICAL_SECTION_HPP
@@ -0,0 +1,230 @@
// crypt.hpp --------------------------------------------------------------//
// Copyright 2014 Antony Polukhin
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_CRYPT_HPP
#define BOOST_DETAIL_WINAPI_CRYPT_HPP
#include <boost/detail/winapi/basic_types.hpp>
#include <boost/detail/winapi/detail/cast_ptr.hpp>
#if defined( BOOST_USE_WINDOWS_H )
// This header is not always included as part of windows.h
#include <wincrypt.h>
#endif
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
namespace boost { namespace detail { namespace winapi {
typedef ULONG_PTR_ HCRYPTPROV_;
}}}
// Some versions of MinGW (including the latest ones) contain buggy declarations of CryptEnumProvidersA and CryptEnumProvidersW.
// We cannot detect those broken versions, and we can't include the system header because it's incomplete.
// So below we duplicate the broken declarations here and work around the problem with cast_ptr. These declarations
// will have to be removed when MinGW is fixed.
extern "C" {
#if !defined( BOOST_NO_ANSI_APIS )
#if !defined( BOOST_WINAPI_IS_MINGW ) || !defined( UNICODE )
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
CryptEnumProvidersA(
boost::detail::winapi::DWORD_ dwIndex,
boost::detail::winapi::DWORD_ *pdwReserved,
boost::detail::winapi::DWORD_ dwFlags,
boost::detail::winapi::DWORD_ *pdwProvType,
boost::detail::winapi::LPSTR_ szProvName,
boost::detail::winapi::DWORD_ *pcbProvName);
#else
// Broken declaration in MinGW
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
CryptEnumProvidersA(
boost::detail::winapi::DWORD_ dwIndex,
boost::detail::winapi::DWORD_ *pdwReserved,
boost::detail::winapi::DWORD_ dwFlags,
boost::detail::winapi::DWORD_ *pdwProvType,
boost::detail::winapi::LPWSTR_ szProvName,
boost::detail::winapi::DWORD_ *pcbProvName);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
CryptAcquireContextA(
boost::detail::winapi::HCRYPTPROV_ *phProv,
boost::detail::winapi::LPCSTR_ pszContainer,
boost::detail::winapi::LPCSTR_ pszProvider,
boost::detail::winapi::DWORD_ dwProvType,
boost::detail::winapi::DWORD_ dwFlags);
#endif // !defined( BOOST_NO_ANSI_APIS )
#if !defined( BOOST_WINAPI_IS_MINGW ) || defined( UNICODE )
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
CryptEnumProvidersW(
boost::detail::winapi::DWORD_ dwIndex,
boost::detail::winapi::DWORD_ *pdwReserved,
boost::detail::winapi::DWORD_ dwFlags,
boost::detail::winapi::DWORD_ *pdwProvType,
boost::detail::winapi::LPWSTR_ szProvName,
boost::detail::winapi::DWORD_ *pcbProvName);
#else
// Broken declaration in MinGW
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
CryptEnumProvidersW(
boost::detail::winapi::DWORD_ dwIndex,
boost::detail::winapi::DWORD_ *pdwReserved,
boost::detail::winapi::DWORD_ dwFlags,
boost::detail::winapi::DWORD_ *pdwProvType,
boost::detail::winapi::LPSTR_ szProvName,
boost::detail::winapi::DWORD_ *pcbProvName);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
CryptAcquireContextW(
boost::detail::winapi::HCRYPTPROV_ *phProv,
boost::detail::winapi::LPCWSTR_ szContainer,
boost::detail::winapi::LPCWSTR_ szProvider,
boost::detail::winapi::DWORD_ dwProvType,
boost::detail::winapi::DWORD_ dwFlags);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
CryptGenRandom(
boost::detail::winapi::HCRYPTPROV_ hProv,
boost::detail::winapi::DWORD_ dwLen,
boost::detail::winapi::BYTE_ *pbBuffer);
#if defined(_MSC_VER) && (_MSC_VER+0) >= 1500 &&\
(\
(defined(NTDDI_VERSION) && (NTDDI_VERSION+0) < BOOST_DETAIL_WINAPI_MAKE_NTDDI_VERSION(BOOST_WINAPI_VERSION_WINXP)) ||\
(!defined(NTDDI_VERSION) && BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_WINXP)\
)
// Standalone MS Windows SDK 6.0A and later provide a different declaration of CryptReleaseContext for Windows 2000 and older.
// This is not the case for (a) MinGW and MinGW-w64 and (b) MSVC 7.1 and 8, which are shipped with their own Windows SDK.
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
CryptReleaseContext(
boost::detail::winapi::HCRYPTPROV_ hProv,
boost::detail::winapi::ULONG_PTR_ dwFlags);
#else
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
CryptReleaseContext(
boost::detail::winapi::HCRYPTPROV_ hProv,
boost::detail::winapi::DWORD_ dwFlags);
#endif
}
#endif // !defined( BOOST_USE_WINDOWS_H )
namespace boost {
namespace detail {
namespace winapi {
#if defined( BOOST_USE_WINDOWS_H )
typedef ::HCRYPTPROV HCRYPTPROV_;
const DWORD_ PROV_RSA_FULL_ = PROV_RSA_FULL;
const DWORD_ CRYPT_VERIFYCONTEXT_ = CRYPT_VERIFYCONTEXT;
const DWORD_ CRYPT_NEWKEYSET_ = CRYPT_NEWKEYSET;
const DWORD_ CRYPT_DELETEKEYSET_ = CRYPT_DELETEKEYSET;
const DWORD_ CRYPT_MACHINE_KEYSET_ = CRYPT_MACHINE_KEYSET;
const DWORD_ CRYPT_SILENT_ = CRYPT_SILENT;
#else
const DWORD_ PROV_RSA_FULL_ = 1;
const DWORD_ CRYPT_VERIFYCONTEXT_ = 0xF0000000;
const DWORD_ CRYPT_NEWKEYSET_ = 8;
const DWORD_ CRYPT_DELETEKEYSET_ = 16;
const DWORD_ CRYPT_MACHINE_KEYSET_ = 32;
const DWORD_ CRYPT_SILENT_ = 64;
#endif
#if !defined( BOOST_NO_ANSI_APIS )
using ::CryptAcquireContextA;
#endif
using ::CryptAcquireContextW;
using ::CryptGenRandom;
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE BOOL_ CryptEnumProvidersA(
DWORD_ dwIndex,
DWORD_ *pdwReserved,
DWORD_ dwFlags,
DWORD_ *pdwProvType,
LPSTR_ szProvName,
DWORD_ *pcbProvName)
{
return ::CryptEnumProvidersA(dwIndex, pdwReserved, dwFlags, pdwProvType, winapi::detail::cast_ptr(szProvName), pcbProvName);
}
BOOST_FORCEINLINE BOOL_ crypt_enum_providers(
DWORD_ dwIndex,
DWORD_ *pdwReserved,
DWORD_ dwFlags,
DWORD_ *pdwProvType,
LPSTR_ szProvName,
DWORD_ *pcbProvName)
{
return ::CryptEnumProvidersA(dwIndex, pdwReserved, dwFlags, pdwProvType, winapi::detail::cast_ptr(szProvName), pcbProvName);
}
BOOST_FORCEINLINE BOOL_ crypt_acquire_context(
HCRYPTPROV_ *phProv,
LPCSTR_ pszContainer,
LPCSTR_ pszProvider,
DWORD_ dwProvType,
DWORD_ dwFlags)
{
return ::CryptAcquireContextA(phProv, pszContainer, pszProvider, dwProvType, dwFlags);
}
#endif
BOOST_FORCEINLINE BOOL_ CryptEnumProvidersW(
DWORD_ dwIndex,
DWORD_ *pdwReserved,
DWORD_ dwFlags,
DWORD_ *pdwProvType,
LPWSTR_ szProvName,
DWORD_ *pcbProvName)
{
return ::CryptEnumProvidersW(dwIndex, pdwReserved, dwFlags, pdwProvType, winapi::detail::cast_ptr(szProvName), pcbProvName);
}
BOOST_FORCEINLINE BOOL_ crypt_enum_providers(
DWORD_ dwIndex,
DWORD_ *pdwReserved,
DWORD_ dwFlags,
DWORD_ *pdwProvType,
LPWSTR_ szProvName,
DWORD_ *pcbProvName)
{
return ::CryptEnumProvidersW(dwIndex, pdwReserved, dwFlags, pdwProvType, winapi::detail::cast_ptr(szProvName), pcbProvName);
}
BOOST_FORCEINLINE BOOL_ crypt_acquire_context(
HCRYPTPROV_ *phProv,
LPCWSTR_ szContainer,
LPCWSTR_ szProvider,
DWORD_ dwProvType,
DWORD_ dwFlags)
{
return ::CryptAcquireContextW(phProv, szContainer, szProvider, dwProvType, dwFlags);
}
BOOST_FORCEINLINE BOOL_ CryptReleaseContext(HCRYPTPROV_ hProv, DWORD_ dwFlags)
{
return ::CryptReleaseContext(hProv, dwFlags);
}
}
}
}
#endif // BOOST_DETAIL_WINAPI_CRYPT_HPP
@@ -0,0 +1,171 @@
// dbghelp.hpp --------------------------------------------------------------//
// Copyright 2015 Klemens Morgenstern
// Copyright 2016 Jorge Lodos
// Copyright 2016 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_DBGHELP_HPP
#define BOOST_DETAIL_WINAPI_DBGHELP_HPP
#include <boost/detail/winapi/basic_types.hpp>
#if defined( BOOST_USE_WINDOWS_H )
#if !defined( BOOST_WINAPI_IS_MINGW )
#include <dbghelp.h>
#else
// In MinGW there is no dbghelp.h but an older imagehlp.h header defines some of the symbols from it.
// Note that the user has to link with libimagehlp.a instead of libdbghelp.a for it to work.
#include <imagehlp.h>
#endif
#endif
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
// Some symbols declared below are not present in all versions of Windows SDK, MinGW and MinGW-w64.
// dbghelp.h/imagehlp.h define the API_VERSION_NUMBER macro which we use to detect its version.
// When the macro is not available we can only guess based on the compiler version or SDK type.
#if defined(API_VERSION_NUMBER)
#if API_VERSION_NUMBER >= 11
// UnDecorateSymbolNameW available since Windows SDK 6.0A and MinGW-w64 (as of 2016-02-14)
#define BOOST_DETAIL_WINAPI_HAS_UNDECORATESYMBOLNAMEW
#endif
#elif defined(_MSC_VER) && _MSC_VER >= 1500
// Until MSVC 9.0 Windows SDK was bundled in Visual Studio and didn't have UnDecorateSymbolNameW.
// Supposedly, Windows SDK 6.0A was the first standalone one and it is used with MSVC 9.0.
#define BOOST_DETAIL_WINAPI_HAS_UNDECORATESYMBOLNAMEW
#elif !defined(BOOST_WINAPI_IS_MINGW)
// MinGW does not provide UnDecorateSymbolNameW (as of 2016-02-14)
#define BOOST_DETAIL_WINAPI_HAS_UNDECORATESYMBOLNAMEW
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
struct API_VERSION;
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
UnDecorateSymbolName(
boost::detail::winapi::LPCSTR_ DecoratedName,
boost::detail::winapi::LPSTR_ UnDecoratedName,
boost::detail::winapi::DWORD_ UndecoratedLength,
boost::detail::winapi::DWORD_ Flags);
#if defined( BOOST_DETAIL_WINAPI_HAS_UNDECORATESYMBOLNAMEW )
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
UnDecorateSymbolNameW(
boost::detail::winapi::LPCWSTR_ DecoratedName,
boost::detail::winapi::LPWSTR_ UnDecoratedName,
boost::detail::winapi::DWORD_ UndecoratedLength,
boost::detail::winapi::DWORD_ Flags);
#endif
BOOST_SYMBOL_IMPORT API_VERSION* WINAPI
ImagehlpApiVersion(BOOST_DETAIL_WINAPI_VOID);
} // extern "C"
#endif
namespace boost {
namespace detail {
namespace winapi {
#if defined( BOOST_USE_WINDOWS_H )
const DWORD_ UNDNAME_COMPLETE_ = UNDNAME_COMPLETE;
const DWORD_ UNDNAME_NO_LEADING_UNDERSCORES_ = UNDNAME_NO_LEADING_UNDERSCORES;
const DWORD_ UNDNAME_NO_MS_KEYWORDS_ = UNDNAME_NO_MS_KEYWORDS;
const DWORD_ UNDNAME_NO_FUNCTION_RETURNS_ = UNDNAME_NO_FUNCTION_RETURNS;
const DWORD_ UNDNAME_NO_ALLOCATION_MODEL_ = UNDNAME_NO_ALLOCATION_MODEL;
const DWORD_ UNDNAME_NO_ALLOCATION_LANGUAGE_ = UNDNAME_NO_ALLOCATION_LANGUAGE;
const DWORD_ UNDNAME_NO_MS_THISTYPE_ = UNDNAME_NO_MS_THISTYPE;
const DWORD_ UNDNAME_NO_CV_THISTYPE_ = UNDNAME_NO_CV_THISTYPE;
const DWORD_ UNDNAME_NO_THISTYPE_ = UNDNAME_NO_THISTYPE;
const DWORD_ UNDNAME_NO_ACCESS_SPECIFIERS_ = UNDNAME_NO_ACCESS_SPECIFIERS;
const DWORD_ UNDNAME_NO_THROW_SIGNATURES_ = UNDNAME_NO_THROW_SIGNATURES;
const DWORD_ UNDNAME_NO_MEMBER_TYPE_ = UNDNAME_NO_MEMBER_TYPE;
const DWORD_ UNDNAME_NO_RETURN_UDT_MODEL_ = UNDNAME_NO_RETURN_UDT_MODEL;
const DWORD_ UNDNAME_32_BIT_DECODE_ = UNDNAME_32_BIT_DECODE;
const DWORD_ UNDNAME_NAME_ONLY_ = UNDNAME_NAME_ONLY;
const DWORD_ UNDNAME_NO_ARGUMENTS_ = UNDNAME_NO_ARGUMENTS;
const DWORD_ UNDNAME_NO_SPECIAL_SYMS_ = UNDNAME_NO_SPECIAL_SYMS;
#else // defined( BOOST_USE_WINDOWS_H )
const DWORD_ UNDNAME_COMPLETE_ = 0x00000000;
const DWORD_ UNDNAME_NO_LEADING_UNDERSCORES_ = 0x00000001;
const DWORD_ UNDNAME_NO_MS_KEYWORDS_ = 0x00000002;
const DWORD_ UNDNAME_NO_FUNCTION_RETURNS_ = 0x00000004;
const DWORD_ UNDNAME_NO_ALLOCATION_MODEL_ = 0x00000008;
const DWORD_ UNDNAME_NO_ALLOCATION_LANGUAGE_ = 0x00000010;
const DWORD_ UNDNAME_NO_MS_THISTYPE_ = 0x00000020;
const DWORD_ UNDNAME_NO_CV_THISTYPE_ = 0x00000040;
const DWORD_ UNDNAME_NO_THISTYPE_ = 0x00000060;
const DWORD_ UNDNAME_NO_ACCESS_SPECIFIERS_ = 0x00000080;
const DWORD_ UNDNAME_NO_THROW_SIGNATURES_ = 0x00000100;
const DWORD_ UNDNAME_NO_MEMBER_TYPE_ = 0x00000200;
const DWORD_ UNDNAME_NO_RETURN_UDT_MODEL_ = 0x00000400;
const DWORD_ UNDNAME_32_BIT_DECODE_ = 0x00000800;
const DWORD_ UNDNAME_NAME_ONLY_ = 0x00001000;
const DWORD_ UNDNAME_NO_ARGUMENTS_ = 0x00002000;
const DWORD_ UNDNAME_NO_SPECIAL_SYMS_ = 0x00004000;
#endif // defined( BOOST_USE_WINDOWS_H )
using ::UnDecorateSymbolName;
#if defined( BOOST_DETAIL_WINAPI_HAS_UNDECORATESYMBOLNAMEW )
using ::UnDecorateSymbolNameW;
#endif
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS API_VERSION {
USHORT_ MajorVersion;
USHORT_ MinorVersion;
USHORT_ Revision;
USHORT_ Reserved;
} API_VERSION_, *LPAPI_VERSION_;
BOOST_FORCEINLINE LPAPI_VERSION_ ImagehlpApiVersion()
{
return reinterpret_cast<LPAPI_VERSION_>(::ImagehlpApiVersion());
}
BOOST_FORCEINLINE DWORD_ undecorate_symbol_name(
LPCSTR_ DecoratedName,
LPSTR_ UnDecoratedName,
DWORD_ UndecoratedLength,
DWORD_ Flags)
{
return ::UnDecorateSymbolName(
DecoratedName,
UnDecoratedName,
UndecoratedLength,
Flags);
}
#if defined( BOOST_DETAIL_WINAPI_HAS_UNDECORATESYMBOLNAMEW )
BOOST_FORCEINLINE DWORD_ undecorate_symbol_name(
LPCWSTR_ DecoratedName,
LPWSTR_ UnDecoratedName,
DWORD_ UndecoratedLength,
DWORD_ Flags)
{
return ::UnDecorateSymbolNameW(
DecoratedName,
UnDecoratedName,
UndecoratedLength,
Flags);
}
#endif
}
}
}
#endif // BOOST_DETAIL_WINAPI_DBGHELP_HPP
@@ -0,0 +1,40 @@
// cast_ptr.hpp --------------------------------------------------------------//
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_DETAIL_CAST_PTR_HPP
#define BOOST_DETAIL_WINAPI_DETAIL_CAST_PTR_HPP
#include <boost/detail/winapi/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
namespace boost {
namespace detail {
namespace winapi {
namespace detail {
//! This class is used to automatically cast pointers to the type used in the current Windows SDK function declarations
class cast_ptr
{
private:
const void* m_p;
public:
explicit BOOST_FORCEINLINE cast_ptr(const void* p) BOOST_NOEXCEPT : m_p(p) {}
template< typename T >
BOOST_FORCEINLINE operator T* () const BOOST_NOEXCEPT { return (T*)m_p; }
};
}
}
}
}
#endif // BOOST_DETAIL_WINAPI_DETAIL_CAST_PTR_HPP
@@ -0,0 +1,94 @@
// directory_management.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_DIRECTORY_MANAGEMENT_HPP
#define BOOST_DETAIL_WINAPI_DIRECTORY_MANAGEMENT_HPP
#include <boost/detail/winapi/basic_types.hpp>
#include <boost/detail/winapi/get_system_directory.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
CreateDirectoryA(boost::detail::winapi::LPCSTR_, ::_SECURITY_ATTRIBUTES*);
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
GetTempPathA(boost::detail::winapi::DWORD_ length, boost::detail::winapi::LPSTR_ buffer);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
RemoveDirectoryA(boost::detail::winapi::LPCSTR_);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
CreateDirectoryW(boost::detail::winapi::LPCWSTR_, ::_SECURITY_ATTRIBUTES*);
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
GetTempPathW(boost::detail::winapi::DWORD_ length, boost::detail::winapi::LPWSTR_ buffer);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
RemoveDirectoryW(boost::detail::winapi::LPCWSTR_);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
#if !defined( BOOST_NO_ANSI_APIS )
using ::GetTempPathA;
using ::RemoveDirectoryA;
#endif
using ::GetTempPathW;
using ::RemoveDirectoryW;
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE BOOL_ CreateDirectoryA(LPCSTR_ pPathName, PSECURITY_ATTRIBUTES_ pSecurityAttributes)
{
return ::CreateDirectoryA(pPathName, reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(pSecurityAttributes));
}
#endif
BOOST_FORCEINLINE BOOL_ CreateDirectoryW(LPCWSTR_ pPathName, PSECURITY_ATTRIBUTES_ pSecurityAttributes)
{
return ::CreateDirectoryW(pPathName, reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(pSecurityAttributes));
}
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE BOOL_ create_directory(LPCSTR_ pPathName, PSECURITY_ATTRIBUTES_ pSecurityAttributes)
{
return ::CreateDirectoryA(pPathName, reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(pSecurityAttributes));
}
BOOST_FORCEINLINE DWORD_ get_temp_path(DWORD_ length, LPSTR_ buffer)
{
return ::GetTempPathA(length, buffer);
}
BOOST_FORCEINLINE BOOL_ remove_directory(LPCSTR_ pPathName)
{
return ::RemoveDirectoryA(pPathName);
}
#endif
BOOST_FORCEINLINE BOOL_ create_directory(LPCWSTR_ pPathName, PSECURITY_ATTRIBUTES_ pSecurityAttributes)
{
return ::CreateDirectoryW(pPathName, reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(pSecurityAttributes));
}
BOOST_FORCEINLINE DWORD_ get_temp_path(DWORD_ length, LPWSTR_ buffer)
{
return ::GetTempPathW(length, buffer);
}
BOOST_FORCEINLINE BOOL_ remove_directory(LPCWSTR_ pPathName)
{
return ::RemoveDirectoryW(pPathName);
}
} // namespace winapi
} // namespace detail
} // namespace boost
#endif // BOOST_DETAIL_WINAPI_DIRECTORY_MANAGEMENT_HPP
@@ -0,0 +1,221 @@
// dll.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2014 Renato Tegon Forti, Antony Polukhin
// Copyright 2015 Andrey Semashev
// Copyright 2015 Antony Polukhin
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_DLL_HPP
#define BOOST_DETAIL_WINAPI_DLL_HPP
#include <boost/detail/winapi/basic_types.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
namespace boost { namespace detail { namespace winapi {
#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
}}} // namespace boost::detail::winapi
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_SYMBOL_IMPORT boost::detail::winapi::HMODULE_ WINAPI
LoadLibraryA(boost::detail::winapi::LPCSTR_ lpFileName);
BOOST_SYMBOL_IMPORT boost::detail::winapi::HMODULE_ WINAPI
LoadLibraryExA(
boost::detail::winapi::LPCSTR_ lpFileName,
boost::detail::winapi::HANDLE_ hFile,
boost::detail::winapi::DWORD_ dwFlags
);
BOOST_SYMBOL_IMPORT boost::detail::winapi::HMODULE_ WINAPI
GetModuleHandleA(boost::detail::winapi::LPCSTR_ lpFileName);
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
GetModuleFileNameA(
boost::detail::winapi::HMODULE_ hModule,
boost::detail::winapi::LPSTR_ lpFilename,
boost::detail::winapi::DWORD_ nSize
);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::HMODULE_ WINAPI
LoadLibraryW(boost::detail::winapi::LPCWSTR_ lpFileName);
BOOST_SYMBOL_IMPORT boost::detail::winapi::HMODULE_ WINAPI
LoadLibraryExW(
boost::detail::winapi::LPCWSTR_ lpFileName,
boost::detail::winapi::HANDLE_ hFile,
boost::detail::winapi::DWORD_ dwFlags
);
BOOST_SYMBOL_IMPORT boost::detail::winapi::HMODULE_ WINAPI
GetModuleHandleW(boost::detail::winapi::LPCWSTR_ lpFileName);
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
GetModuleFileNameW(
boost::detail::winapi::HMODULE_ hModule,
boost::detail::winapi::LPWSTR_ lpFilename,
boost::detail::winapi::DWORD_ nSize
);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
FreeLibrary(boost::detail::winapi::HMODULE_ hModule);
#if !defined( UNDER_CE )
BOOST_SYMBOL_IMPORT boost::detail::winapi::FARPROC_ WINAPI
GetProcAddress(boost::detail::winapi::HMODULE_ hModule, boost::detail::winapi::LPCSTR_ lpProcName);
#else
// On Windows CE there are two functions: GetProcAddressA (since Windows CE 3.0) and GetProcAddressW.
// GetProcAddress is a macro that is _always_ defined to GetProcAddressW.
BOOST_SYMBOL_IMPORT boost::detail::winapi::FARPROC_ WINAPI
GetProcAddressA(boost::detail::winapi::HMODULE_ hModule, boost::detail::winapi::LPCSTR_ lpProcName);
BOOST_SYMBOL_IMPORT boost::detail::winapi::FARPROC_ WINAPI
GetProcAddressW(boost::detail::winapi::HMODULE_ hModule, boost::detail::winapi::LPCWSTR_ lpProcName);
#endif
struct _MEMORY_BASIC_INFORMATION;
#if !defined( BOOST_WINAPI_IS_MINGW )
BOOST_SYMBOL_IMPORT boost::detail::winapi::SIZE_T_ WINAPI
VirtualQuery(
boost::detail::winapi::LPCVOID_ lpAddress,
::_MEMORY_BASIC_INFORMATION* lpBuffer,
boost::detail::winapi::ULONG_PTR_ dwLength
);
#else // !defined( BOOST_WINAPI_IS_MINGW )
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
VirtualQuery(
boost::detail::winapi::LPCVOID_ lpAddress,
::_MEMORY_BASIC_INFORMATION* lpBuffer,
boost::detail::winapi::DWORD_ dwLength
);
#endif // !defined( BOOST_WINAPI_IS_MINGW )
} // extern "C"
#endif // #if !defined( BOOST_USE_WINDOWS_H )
namespace boost {
namespace detail {
namespace winapi {
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS MEMORY_BASIC_INFORMATION_ {
PVOID_ BaseAddress;
PVOID_ AllocationBase;
DWORD_ AllocationProtect;
SIZE_T_ RegionSize;
DWORD_ State;
DWORD_ Protect;
DWORD_ Type;
} *PMEMORY_BASIC_INFORMATION_;
#if defined( BOOST_USE_WINDOWS_H )
typedef ::FARPROC FARPROC_;
typedef ::NEARPROC NEARPROC_;
typedef ::PROC PROC_;
const DWORD_ DONT_RESOLVE_DLL_REFERENCES_ = DONT_RESOLVE_DLL_REFERENCES;
const DWORD_ LOAD_WITH_ALTERED_SEARCH_PATH_ = LOAD_WITH_ALTERED_SEARCH_PATH;
#else // defined( BOOST_USE_WINDOWS_H )
const DWORD_ DONT_RESOLVE_DLL_REFERENCES_ = 0x00000001;
const DWORD_ LOAD_WITH_ALTERED_SEARCH_PATH_ = 0x00000008;
#endif // defined( BOOST_USE_WINDOWS_H )
// This one is not defined by MinGW
const DWORD_ LOAD_IGNORE_CODE_AUTHZ_LEVEL_ = 0x00000010;
#if !defined( BOOST_NO_ANSI_APIS )
using ::LoadLibraryA;
using ::LoadLibraryExA;
using ::GetModuleHandleA;
using ::GetModuleFileNameA;
#endif // !defined( BOOST_NO_ANSI_APIS )
using ::LoadLibraryW;
using ::LoadLibraryExW;
using ::GetModuleHandleW;
using ::GetModuleFileNameW;
using ::FreeLibrary;
#if !defined( UNDER_CE )
// For backward compatibility, don't use directly. Use get_proc_address instead.
using ::GetProcAddress;
#else
using ::GetProcAddressA;
using ::GetProcAddressW;
#endif
BOOST_FORCEINLINE FARPROC_ get_proc_address(HMODULE_ hModule, LPCSTR_ lpProcName)
{
#if !defined( UNDER_CE )
return ::GetProcAddress(hModule, lpProcName);
#else
return ::GetProcAddressA(hModule, lpProcName);
#endif
}
BOOST_FORCEINLINE SIZE_T_ VirtualQuery(LPCVOID_ lpAddress, MEMORY_BASIC_INFORMATION_* lpBuffer, ULONG_PTR_ dwLength)
{
return ::VirtualQuery(lpAddress, reinterpret_cast< ::_MEMORY_BASIC_INFORMATION* >(lpBuffer), dwLength);
}
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE HMODULE_ load_library(LPCSTR_ lpFileName)
{
return ::LoadLibraryA(lpFileName);
}
BOOST_FORCEINLINE HMODULE_ load_library_ex(LPCSTR_ lpFileName, HANDLE_ hFile, DWORD_ dwFlags)
{
return ::LoadLibraryExA(lpFileName, hFile, dwFlags);
}
BOOST_FORCEINLINE HMODULE_ get_module_handle(LPCSTR_ lpFileName)
{
return ::GetModuleHandleA(lpFileName);
}
BOOST_FORCEINLINE DWORD_ get_module_file_name(HMODULE_ hModule, LPSTR_ lpFilename, DWORD_ nSize)
{
return ::GetModuleFileNameA(hModule, lpFilename, nSize);
}
#endif // #if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE HMODULE_ load_library(LPCWSTR_ lpFileName)
{
return ::LoadLibraryW(lpFileName);
}
BOOST_FORCEINLINE HMODULE_ load_library_ex(LPCWSTR_ lpFileName, HANDLE_ hFile, DWORD_ dwFlags)
{
return ::LoadLibraryExW(lpFileName, hFile, dwFlags);
}
BOOST_FORCEINLINE HMODULE_ get_module_handle(LPCWSTR_ lpFileName)
{
return ::GetModuleHandleW(lpFileName);
}
BOOST_FORCEINLINE DWORD_ get_module_file_name(HMODULE_ hModule, LPWSTR_ lpFilename, DWORD_ nSize)
{
return ::GetModuleFileNameW(hModule, lpFilename, nSize);
}
} // namespace winapi
} // namespace detail
} // namespace boost
#endif // BOOST_DETAIL_WINAPI_DLL_HPP
@@ -0,0 +1,118 @@
// environment.hpp --------------------------------------------------------------//
// Copyright 2016 Klemens D. Morgenstern
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_ENVIRONMENT_HPP_
#define BOOST_DETAIL_WINAPI_ENVIRONMENT_HPP_
#include <boost/detail/winapi/basic_types.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_SYMBOL_IMPORT boost::detail::winapi::LPSTR_ WINAPI GetEnvironmentStringsA();
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI FreeEnvironmentStringsA(boost::detail::winapi::LPSTR_);
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI GetEnvironmentVariableA(
boost::detail::winapi::LPCSTR_ lpName,
boost::detail::winapi::LPSTR_ lpBuffer,
boost::detail::winapi::DWORD_ nSize
);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI SetEnvironmentVariableA(
boost::detail::winapi::LPCSTR_ lpName,
boost::detail::winapi::LPCSTR_ lpValue
);
#endif // !defined( BOOST_NO_ANSI_APIS )
BOOST_SYMBOL_IMPORT boost::detail::winapi::LPWSTR_ WINAPI GetEnvironmentStringsW();
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI FreeEnvironmentStringsW(boost::detail::winapi::LPWSTR_);
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI GetEnvironmentVariableW(
boost::detail::winapi::LPCWSTR_ lpName,
boost::detail::winapi::LPWSTR_ lpBuffer,
boost::detail::winapi::DWORD_ nSize
);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI SetEnvironmentVariableW(
boost::detail::winapi::LPCWSTR_ lpName,
boost::detail::winapi::LPCWSTR_ lpValue
);
} // extern "C"
#endif // !defined( BOOST_USE_WINDOWS_H )
namespace boost { namespace detail { namespace winapi {
#if !defined( BOOST_NO_ANSI_APIS )
using ::GetEnvironmentStringsA;
using ::FreeEnvironmentStringsA;
using ::GetEnvironmentVariableA;
using ::SetEnvironmentVariableA;
#endif // !defined( BOOST_NO_ANSI_APIS )
using ::GetEnvironmentStringsW;
using ::FreeEnvironmentStringsW;
using ::GetEnvironmentVariableW;
using ::SetEnvironmentVariableW;
template< typename Char >
Char* get_environment_strings();
#if !defined( BOOST_NO_ANSI_APIS )
template< >
BOOST_FORCEINLINE char* get_environment_strings< char >()
{
return GetEnvironmentStringsA();
}
BOOST_FORCEINLINE BOOL_ free_environment_strings(boost::detail::winapi::LPSTR_ p)
{
return FreeEnvironmentStringsA(p);
}
BOOST_FORCEINLINE DWORD_ get_environment_variable(LPCSTR_ name, LPSTR_ buffer, DWORD_ size)
{
return GetEnvironmentVariableA(name, buffer, size);
}
BOOST_FORCEINLINE BOOL_ set_environment_variable(LPCSTR_ name, LPCSTR_ value)
{
return SetEnvironmentVariableA(name, value);
}
#endif // !defined( BOOST_NO_ANSI_APIS )
template< >
BOOST_FORCEINLINE wchar_t* get_environment_strings< wchar_t >()
{
return GetEnvironmentStringsW();
}
BOOST_FORCEINLINE BOOL_ free_environment_strings(boost::detail::winapi::LPWSTR_ p)
{
return FreeEnvironmentStringsW(p);
}
BOOST_FORCEINLINE DWORD_ get_environment_variable(LPCWSTR_ name, LPWSTR_ buffer, DWORD_ size)
{
return GetEnvironmentVariableW(name, buffer, size);
}
BOOST_FORCEINLINE BOOL_ set_environment_variable(LPCWSTR_ name, LPCWSTR_ value)
{
return SetEnvironmentVariableW(name, value);
}
} // namespace winapi
} // namespace detail
} // namespace boost
#endif // BOOST_DETAIL_WINAPI_ENVIRONMENT_HPP_
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,143 @@
// error_handling.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Copyright 2016 Jorge Lodos
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_ERROR_HANDLING_HPP
#define BOOST_DETAIL_WINAPI_ERROR_HANDLING_HPP
#include <stdarg.h>
#include <boost/detail/winapi/basic_types.hpp>
#include <boost/detail/winapi/get_last_error.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
FormatMessageA(
boost::detail::winapi::DWORD_ dwFlags,
boost::detail::winapi::LPCVOID_ lpSource,
boost::detail::winapi::DWORD_ dwMessageId,
boost::detail::winapi::DWORD_ dwLanguageId,
boost::detail::winapi::LPSTR_ lpBuffer,
boost::detail::winapi::DWORD_ nSize,
va_list *Arguments);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
FormatMessageW(
boost::detail::winapi::DWORD_ dwFlags,
boost::detail::winapi::LPCVOID_ lpSource,
boost::detail::winapi::DWORD_ dwMessageId,
boost::detail::winapi::DWORD_ dwLanguageId,
boost::detail::winapi::LPWSTR_ lpBuffer,
boost::detail::winapi::DWORD_ nSize,
va_list *Arguments);
BOOST_SYMBOL_IMPORT boost::detail::winapi::UINT_ WINAPI
SetErrorMode(boost::detail::winapi::UINT_ uMode);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
#if defined( BOOST_USE_WINDOWS_H )
const DWORD_ FORMAT_MESSAGE_ALLOCATE_BUFFER_= FORMAT_MESSAGE_ALLOCATE_BUFFER;
const DWORD_ FORMAT_MESSAGE_IGNORE_INSERTS_= FORMAT_MESSAGE_IGNORE_INSERTS;
const DWORD_ FORMAT_MESSAGE_FROM_STRING_= FORMAT_MESSAGE_FROM_STRING;
const DWORD_ FORMAT_MESSAGE_FROM_HMODULE_= FORMAT_MESSAGE_FROM_HMODULE;
const DWORD_ FORMAT_MESSAGE_FROM_SYSTEM_= FORMAT_MESSAGE_FROM_SYSTEM;
const DWORD_ FORMAT_MESSAGE_ARGUMENT_ARRAY_= FORMAT_MESSAGE_ARGUMENT_ARRAY;
const DWORD_ FORMAT_MESSAGE_MAX_WIDTH_MASK_= FORMAT_MESSAGE_MAX_WIDTH_MASK;
const WORD_ LANG_NEUTRAL_= LANG_NEUTRAL;
const WORD_ LANG_INVARIANT_= LANG_INVARIANT;
const WORD_ SUBLANG_DEFAULT_= SUBLANG_DEFAULT; // user default
BOOST_FORCEINLINE WORD_ MAKELANGID_(WORD_ p, WORD_ s)
{
return MAKELANGID(p,s);
}
const DWORD_ SEM_FAILCRITICALERRORS_ = SEM_FAILCRITICALERRORS;
const DWORD_ SEM_NOGPFAULTERRORBOX_ = SEM_NOGPFAULTERRORBOX;
const DWORD_ SEM_NOALIGNMENTFAULTEXCEPT_ = SEM_NOALIGNMENTFAULTEXCEPT;
const DWORD_ SEM_NOOPENFILEERRORBOX_ = SEM_NOOPENFILEERRORBOX;
#else
const DWORD_ FORMAT_MESSAGE_ALLOCATE_BUFFER_= 0x00000100;
const DWORD_ FORMAT_MESSAGE_IGNORE_INSERTS_= 0x00000200;
const DWORD_ FORMAT_MESSAGE_FROM_STRING_= 0x00000400;
const DWORD_ FORMAT_MESSAGE_FROM_HMODULE_= 0x00000800;
const DWORD_ FORMAT_MESSAGE_FROM_SYSTEM_= 0x00001000;
const DWORD_ FORMAT_MESSAGE_ARGUMENT_ARRAY_= 0x00002000;
const DWORD_ FORMAT_MESSAGE_MAX_WIDTH_MASK_= 0x000000FF;
const WORD_ LANG_NEUTRAL_= 0x00;
const WORD_ LANG_INVARIANT_= 0x7f;
const WORD_ SUBLANG_DEFAULT_= 0x01; // user default
BOOST_FORCEINLINE WORD_ MAKELANGID_(WORD_ p, WORD_ s)
{
return (WORD_)((((WORD_)(s)) << 10) | (WORD_)(p));
}
const DWORD_ SEM_FAILCRITICALERRORS_ = 0x0001;
const DWORD_ SEM_NOGPFAULTERRORBOX_ = 0x0002;
const DWORD_ SEM_NOALIGNMENTFAULTEXCEPT_ = 0x0004;
const DWORD_ SEM_NOOPENFILEERRORBOX_ = 0x8000;
#endif
#if !defined( BOOST_NO_ANSI_APIS )
using ::FormatMessageA;
#endif
using ::FormatMessageW;
using ::SetErrorMode;
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE DWORD_ format_message(
DWORD_ dwFlags,
LPCVOID_ lpSource,
DWORD_ dwMessageId,
DWORD_ dwLanguageId,
LPSTR_ lpBuffer,
DWORD_ nSize,
va_list *Arguments)
{
return ::FormatMessageA(dwFlags, lpSource, dwMessageId, dwLanguageId, lpBuffer, nSize, Arguments);
}
#endif
BOOST_FORCEINLINE DWORD_ format_message(
DWORD_ dwFlags,
LPCVOID_ lpSource,
DWORD_ dwMessageId,
DWORD_ dwLanguageId,
LPWSTR_ lpBuffer,
DWORD_ nSize,
va_list *Arguments)
{
return ::FormatMessageW(dwFlags, lpSource, dwMessageId, dwLanguageId, lpBuffer, nSize, Arguments);
}
}
}
}
#endif // BOOST_DETAIL_WINAPI_ERROR_HANDLING_HPP
@@ -0,0 +1,190 @@
// event.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_EVENT_HPP
#define BOOST_DETAIL_WINAPI_EVENT_HPP
#include <boost/detail/winapi/basic_types.hpp>
#include <boost/predef/platform.h>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
#if !defined( BOOST_NO_ANSI_APIS )
#if !defined( BOOST_PLAT_WINDOWS_RUNTIME_AVALIABLE )
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
CreateEventA(
::_SECURITY_ATTRIBUTES* lpEventAttributes,
boost::detail::winapi::BOOL_ bManualReset,
boost::detail::winapi::BOOL_ bInitialState,
boost::detail::winapi::LPCSTR_ lpName);
#endif
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
CreateEventExA(
::_SECURITY_ATTRIBUTES *lpEventAttributes,
boost::detail::winapi::LPCSTR_ lpName,
boost::detail::winapi::DWORD_ dwFlags,
boost::detail::winapi::DWORD_ dwDesiredAccess);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
OpenEventA(
boost::detail::winapi::DWORD_ dwDesiredAccess,
boost::detail::winapi::BOOL_ bInheritHandle,
boost::detail::winapi::LPCSTR_ lpName);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
CreateEventW(
::_SECURITY_ATTRIBUTES* lpEventAttributes,
boost::detail::winapi::BOOL_ bManualReset,
boost::detail::winapi::BOOL_ bInitialState,
boost::detail::winapi::LPCWSTR_ lpName);
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
CreateEventExW(
::_SECURITY_ATTRIBUTES *lpEventAttributes,
boost::detail::winapi::LPCWSTR_ lpName,
boost::detail::winapi::DWORD_ dwFlags,
boost::detail::winapi::DWORD_ dwDesiredAccess);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
OpenEventW(
boost::detail::winapi::DWORD_ dwDesiredAccess,
boost::detail::winapi::BOOL_ bInheritHandle,
boost::detail::winapi::LPCWSTR_ lpName);
// Windows CE define SetEvent/ResetEvent as inline functions in kfuncs.h
#if !defined( UNDER_CE )
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
SetEvent(boost::detail::winapi::HANDLE_ hEvent);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
ResetEvent(boost::detail::winapi::HANDLE_ hEvent);
#endif
}
#endif
namespace boost {
namespace detail {
namespace winapi {
#if !defined( BOOST_NO_ANSI_APIS )
using ::OpenEventA;
#endif
using ::OpenEventW;
using ::SetEvent;
using ::ResetEvent;
#if defined( BOOST_USE_WINDOWS_H )
const DWORD_ EVENT_ALL_ACCESS_ = EVENT_ALL_ACCESS;
const DWORD_ EVENT_MODIFY_STATE_ = EVENT_MODIFY_STATE;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
const DWORD_ CREATE_EVENT_INITIAL_SET_ = CREATE_EVENT_INITIAL_SET;
const DWORD_ CREATE_EVENT_MANUAL_RESET_ = CREATE_EVENT_MANUAL_RESET;
#endif
#else // defined( BOOST_USE_WINDOWS_H )
const DWORD_ EVENT_ALL_ACCESS_ = 0x001F0003;
const DWORD_ EVENT_MODIFY_STATE_ = 0x00000002;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
const DWORD_ CREATE_EVENT_INITIAL_SET_ = 0x00000002;
const DWORD_ CREATE_EVENT_MANUAL_RESET_ = 0x00000001;
#endif
#endif // defined( BOOST_USE_WINDOWS_H )
// Undocumented and not present in Windows SDK. Enables NtQueryEvent.
// http://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FNT%20Objects%2FEvent%2FNtQueryEvent.html
const DWORD_ EVENT_QUERY_STATE_ = 0x00000001;
const DWORD_ event_all_access = EVENT_ALL_ACCESS_;
const DWORD_ event_modify_state = EVENT_MODIFY_STATE_;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
const DWORD_ create_event_initial_set = CREATE_EVENT_INITIAL_SET_;
const DWORD_ create_event_manual_reset = CREATE_EVENT_MANUAL_RESET_;
#endif
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE HANDLE_ CreateEventA(SECURITY_ATTRIBUTES_* lpEventAttributes, BOOL_ bManualReset, BOOL_ bInitialState, LPCSTR_ lpName)
{
#if BOOST_PLAT_WINDOWS_RUNTIME && BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
const DWORD_ flags = (bManualReset ? create_event_manual_reset : 0u) | (bInitialState ? create_event_initial_set : 0u);
return ::CreateEventExA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpEventAttributes), lpName, flags, event_all_access);
#else
return ::CreateEventA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpEventAttributes), bManualReset, bInitialState, lpName);
#endif
}
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
BOOST_FORCEINLINE HANDLE_ CreateEventExA(SECURITY_ATTRIBUTES_* lpEventAttributes, LPCSTR_ lpName, DWORD_ dwFlags, DWORD_ dwDesiredAccess)
{
return ::CreateEventExA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpEventAttributes), lpName, dwFlags, dwDesiredAccess);
}
#endif
#endif
BOOST_FORCEINLINE HANDLE_ CreateEventW(SECURITY_ATTRIBUTES_* lpEventAttributes, BOOL_ bManualReset, BOOL_ bInitialState, LPCWSTR_ lpName)
{
#if BOOST_PLAT_WINDOWS_RUNTIME && BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
const DWORD_ flags = (bManualReset ? create_event_manual_reset : 0u) | (bInitialState ? create_event_initial_set : 0u);
return ::CreateEventExW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpEventAttributes), lpName, flags, event_all_access);
#else
return ::CreateEventW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpEventAttributes), bManualReset, bInitialState, lpName);
#endif
}
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
BOOST_FORCEINLINE HANDLE_ CreateEventExW(SECURITY_ATTRIBUTES_* lpEventAttributes, LPCWSTR_ lpName, DWORD_ dwFlags, DWORD_ dwDesiredAccess)
{
return ::CreateEventExW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpEventAttributes), lpName, dwFlags, dwDesiredAccess);
}
#endif
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE HANDLE_ create_event(SECURITY_ATTRIBUTES_* lpEventAttributes, BOOL_ bManualReset, BOOL_ bInitialState, LPCSTR_ lpName)
{
return winapi::CreateEventA(lpEventAttributes, bManualReset, bInitialState, lpName);
}
BOOST_FORCEINLINE HANDLE_ open_event(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCSTR_ lpName)
{
return ::OpenEventA(dwDesiredAccess, bInheritHandle, lpName);
}
#endif
BOOST_FORCEINLINE HANDLE_ create_event(SECURITY_ATTRIBUTES_* lpEventAttributes, BOOL_ bManualReset, BOOL_ bInitialState, LPCWSTR_ lpName)
{
return winapi::CreateEventW(lpEventAttributes, bManualReset, bInitialState, lpName);
}
BOOST_FORCEINLINE HANDLE_ open_event(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCWSTR_ lpName)
{
return ::OpenEventW(dwDesiredAccess, bInheritHandle, lpName);
}
BOOST_FORCEINLINE HANDLE_ create_anonymous_event(SECURITY_ATTRIBUTES_* lpEventAttributes, BOOL_ bManualReset, BOOL_ bInitialState)
{
return winapi::CreateEventW(lpEventAttributes, bManualReset, bInitialState, 0);
}
}
}
}
#endif // BOOST_DETAIL_WINAPI_EVENT_HPP
@@ -0,0 +1,535 @@
// file_management.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Copyright 2016 Jorge Lodos
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_FILE_MANAGEMENT_HPP
#define BOOST_DETAIL_WINAPI_FILE_MANAGEMENT_HPP
#include <boost/detail/winapi/basic_types.hpp>
#include <boost/detail/winapi/limits.hpp>
#include <boost/detail/winapi/time.hpp>
#include <boost/detail/winapi/overlapped.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
CreateFileA(
boost::detail::winapi::LPCSTR_ lpFileName,
boost::detail::winapi::DWORD_ dwDesiredAccess,
boost::detail::winapi::DWORD_ dwShareMode,
::_SECURITY_ATTRIBUTES* lpSecurityAttributes,
boost::detail::winapi::DWORD_ dwCreationDisposition,
boost::detail::winapi::DWORD_ dwFlagsAndAttributes,
boost::detail::winapi::HANDLE_ hTemplateFile);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
DeleteFileA(boost::detail::winapi::LPCSTR_ lpFileName);
struct _WIN32_FIND_DATAA;
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
FindFirstFileA(boost::detail::winapi::LPCSTR_ lpFileName, ::_WIN32_FIND_DATAA* lpFindFileData);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
FindNextFileA(boost::detail::winapi::HANDLE_ hFindFile, ::_WIN32_FIND_DATAA* lpFindFileData);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
MoveFileExA(
boost::detail::winapi::LPCSTR_ lpExistingFileName,
boost::detail::winapi::LPCSTR_ lpNewFileName,
boost::detail::winapi::DWORD_ dwFlags);
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
GetFileAttributesA(boost::detail::winapi::LPCSTR_ lpFileName);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
AreFileApisANSI(BOOST_DETAIL_WINAPI_VOID);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
CreateFileW(
boost::detail::winapi::LPCWSTR_ lpFileName,
boost::detail::winapi::DWORD_ dwDesiredAccess,
boost::detail::winapi::DWORD_ dwShareMode,
::_SECURITY_ATTRIBUTES* lpSecurityAttributes,
boost::detail::winapi::DWORD_ dwCreationDisposition,
boost::detail::winapi::DWORD_ dwFlagsAndAttributes,
boost::detail::winapi::HANDLE_ hTemplateFile);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
DeleteFileW(boost::detail::winapi::LPCWSTR_ lpFileName);
struct _WIN32_FIND_DATAW;
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
FindFirstFileW(boost::detail::winapi::LPCWSTR_ lpFileName, ::_WIN32_FIND_DATAW* lpFindFileData);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
FindNextFileW(boost::detail::winapi::HANDLE_ hFindFile, ::_WIN32_FIND_DATAW* lpFindFileData);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
MoveFileExW(
boost::detail::winapi::LPCWSTR_ lpExistingFileName,
boost::detail::winapi::LPCWSTR_ lpNewFileName,
boost::detail::winapi::DWORD_ dwFlags);
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
GetFileAttributesW(boost::detail::winapi::LPCWSTR_ lpFileName);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
FindClose(boost::detail::winapi::HANDLE_ hFindFile);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
GetFileSizeEx(boost::detail::winapi::HANDLE_ hFile, ::_LARGE_INTEGER* lpFileSize);
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WINXP
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
SetFileValidData(boost::detail::winapi::HANDLE_ hFile, boost::detail::winapi::LONGLONG_ ValidDataLength);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
SetEndOfFile(boost::detail::winapi::HANDLE_ hFile);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
LockFile(
boost::detail::winapi::HANDLE_ hFile,
boost::detail::winapi::DWORD_ dwFileOffsetLow,
boost::detail::winapi::DWORD_ dwFileOffsetHigh,
boost::detail::winapi::DWORD_ nNumberOfBytesToLockLow,
boost::detail::winapi::DWORD_ nNumberOfBytesToLockHigh);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
UnlockFile(
boost::detail::winapi::HANDLE_ hFile,
boost::detail::winapi::DWORD_ dwFileOffsetLow,
boost::detail::winapi::DWORD_ dwFileOffsetHigh,
boost::detail::winapi::DWORD_ nNumberOfBytesToUnlockLow,
boost::detail::winapi::DWORD_ nNumberOfBytesToUnlockHigh);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
LockFileEx(
boost::detail::winapi::HANDLE_ hFile,
boost::detail::winapi::DWORD_ dwFlags,
boost::detail::winapi::DWORD_ dwReserved,
boost::detail::winapi::DWORD_ nNumberOfBytesToLockLow,
boost::detail::winapi::DWORD_ nNumberOfBytesToLockHigh,
::_OVERLAPPED* lpOverlapped);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
UnlockFileEx(
boost::detail::winapi::HANDLE_ hFile,
boost::detail::winapi::DWORD_ dwReserved,
boost::detail::winapi::DWORD_ nNumberOfBytesToUnlockLow,
boost::detail::winapi::DWORD_ nNumberOfBytesToUnlockHigh,
::_OVERLAPPED* lpOverlapped);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
ReadFile(
boost::detail::winapi::HANDLE_ hFile,
boost::detail::winapi::LPVOID_ lpBuffer,
boost::detail::winapi::DWORD_ nNumberOfBytesToRead,
boost::detail::winapi::LPDWORD_ lpNumberOfBytesRead,
::_OVERLAPPED* lpOverlapped);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
WriteFile(
boost::detail::winapi::HANDLE_ hFile,
boost::detail::winapi::LPCVOID_ lpBuffer,
boost::detail::winapi::DWORD_ nNumberOfBytesToWrite,
boost::detail::winapi::LPDWORD_ lpNumberOfBytesWritten,
::_OVERLAPPED* lpOverlapped);
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
SetFilePointer(
boost::detail::winapi::HANDLE_ hFile,
boost::detail::winapi::LONG_ lpDistanceToMove,
boost::detail::winapi::PLONG_ lpDistanceToMoveHigh,
boost::detail::winapi::DWORD_ dwMoveMethod);
struct _BY_HANDLE_FILE_INFORMATION;
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
GetFileInformationByHandle(
boost::detail::winapi::HANDLE_ hFile,
::_BY_HANDLE_FILE_INFORMATION* lpFileInformation);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
#if defined( BOOST_USE_WINDOWS_H )
const DWORD_ INVALID_FILE_SIZE_ = INVALID_FILE_SIZE;
const DWORD_ INVALID_SET_FILE_POINTER_ = INVALID_SET_FILE_POINTER;
const DWORD_ INVALID_FILE_ATTRIBUTES_ = INVALID_FILE_ATTRIBUTES;
const DWORD_ FILE_ATTRIBUTE_READONLY_ = FILE_ATTRIBUTE_READONLY;
const DWORD_ FILE_ATTRIBUTE_HIDDEN_ = FILE_ATTRIBUTE_HIDDEN;
const DWORD_ FILE_ATTRIBUTE_SYSTEM_ = FILE_ATTRIBUTE_SYSTEM;
const DWORD_ FILE_ATTRIBUTE_DIRECTORY_ = FILE_ATTRIBUTE_DIRECTORY;
const DWORD_ FILE_ATTRIBUTE_ARCHIVE_ = FILE_ATTRIBUTE_ARCHIVE;
const DWORD_ FILE_ATTRIBUTE_DEVICE_ = FILE_ATTRIBUTE_DEVICE;
const DWORD_ FILE_ATTRIBUTE_NORMAL_ = FILE_ATTRIBUTE_NORMAL;
const DWORD_ FILE_ATTRIBUTE_TEMPORARY_ = FILE_ATTRIBUTE_TEMPORARY;
const DWORD_ FILE_ATTRIBUTE_SPARSE_FILE_ = FILE_ATTRIBUTE_SPARSE_FILE;
const DWORD_ FILE_ATTRIBUTE_REPARSE_POINT_ = FILE_ATTRIBUTE_REPARSE_POINT;
const DWORD_ FILE_ATTRIBUTE_COMPRESSED_ = FILE_ATTRIBUTE_COMPRESSED;
const DWORD_ FILE_ATTRIBUTE_OFFLINE_ = FILE_ATTRIBUTE_OFFLINE;
const DWORD_ FILE_ATTRIBUTE_NOT_CONTENT_INDEXED_ = FILE_ATTRIBUTE_NOT_CONTENT_INDEXED;
const DWORD_ FILE_ATTRIBUTE_ENCRYPTED_ = FILE_ATTRIBUTE_ENCRYPTED;
const DWORD_ CREATE_NEW_ = CREATE_NEW;
const DWORD_ CREATE_ALWAYS_ = CREATE_ALWAYS;
const DWORD_ OPEN_EXISTING_ = OPEN_EXISTING;
const DWORD_ OPEN_ALWAYS_ = OPEN_ALWAYS;
const DWORD_ TRUNCATE_EXISTING_ = TRUNCATE_EXISTING;
const DWORD_ FILE_SHARE_READ_ = FILE_SHARE_READ;
const DWORD_ FILE_SHARE_WRITE_ = FILE_SHARE_WRITE;
const DWORD_ FILE_SHARE_DELETE_ = FILE_SHARE_DELETE;
const DWORD_ FILE_BEGIN_ = FILE_BEGIN;
const DWORD_ FILE_CURRENT_ = FILE_CURRENT;
const DWORD_ FILE_END_ = FILE_END;
#else // defined( BOOST_USE_WINDOWS_H )
const DWORD_ INVALID_FILE_SIZE_ = ((DWORD_)0xFFFFFFFF);
const DWORD_ INVALID_SET_FILE_POINTER_ = ((DWORD_)-1);
const DWORD_ INVALID_FILE_ATTRIBUTES_ = ((DWORD_)-1);
const DWORD_ FILE_ATTRIBUTE_READONLY_ = 0x00000001;
const DWORD_ FILE_ATTRIBUTE_HIDDEN_ = 0x00000002;
const DWORD_ FILE_ATTRIBUTE_SYSTEM_ = 0x00000004;
const DWORD_ FILE_ATTRIBUTE_DIRECTORY_ = 0x00000010;
const DWORD_ FILE_ATTRIBUTE_ARCHIVE_ = 0x00000020;
const DWORD_ FILE_ATTRIBUTE_DEVICE_ = 0x00000040;
const DWORD_ FILE_ATTRIBUTE_NORMAL_ = 0x00000080;
const DWORD_ FILE_ATTRIBUTE_TEMPORARY_ = 0x00000100;
const DWORD_ FILE_ATTRIBUTE_SPARSE_FILE_ = 0x00000200;
const DWORD_ FILE_ATTRIBUTE_REPARSE_POINT_ = 0x00000400;
const DWORD_ FILE_ATTRIBUTE_COMPRESSED_ = 0x00000800;
const DWORD_ FILE_ATTRIBUTE_OFFLINE_ = 0x00001000;
const DWORD_ FILE_ATTRIBUTE_NOT_CONTENT_INDEXED_ = 0x00002000;
const DWORD_ FILE_ATTRIBUTE_ENCRYPTED_ = 0x00004000;
const DWORD_ CREATE_NEW_ = 1;
const DWORD_ CREATE_ALWAYS_ = 2;
const DWORD_ OPEN_EXISTING_ = 3;
const DWORD_ OPEN_ALWAYS_ = 4;
const DWORD_ TRUNCATE_EXISTING_ = 5;
const DWORD_ FILE_SHARE_READ_ = 0x00000001;
const DWORD_ FILE_SHARE_WRITE_ = 0x00000002;
const DWORD_ FILE_SHARE_DELETE_ = 0x00000004;
const DWORD_ FILE_BEGIN_ = 0;
const DWORD_ FILE_CURRENT_ = 1;
const DWORD_ FILE_END_ = 2;
#endif // defined( BOOST_USE_WINDOWS_H )
// This constant is not defined in Windows SDK up until 6.0A
const DWORD_ FILE_ATTRIBUTE_VIRTUAL_ = 0x00010000;
// These constants are not defined in Windows SDK up until 8.0 and MinGW/MinGW-w64 (as of 2016-02-14).
// They are documented to be supported only since Windows 8/Windows Server 2012
// but defined unconditionally.
const DWORD_ FILE_ATTRIBUTE_INTEGRITY_STREAM_ = 0x00008000;
const DWORD_ FILE_ATTRIBUTE_NO_SCRUB_DATA_ = 0x00020000;
// Undocumented
const DWORD_ FILE_ATTRIBUTE_EA_ = 0x00040000;
#if !defined( BOOST_NO_ANSI_APIS )
using ::DeleteFileA;
using ::MoveFileExA;
using ::GetFileAttributesA;
using ::AreFileApisANSI;
#endif
using ::DeleteFileW;
using ::MoveFileExW;
using ::GetFileAttributesW;
using ::FindClose;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WINXP
using ::SetFileValidData;
#endif
using ::SetEndOfFile;
using ::LockFile;
using ::UnlockFile;
using ::SetFilePointer;
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE HANDLE_ CreateFileA(
LPCSTR_ lpFileName,
DWORD_ dwDesiredAccess,
DWORD_ dwShareMode,
SECURITY_ATTRIBUTES_* lpSecurityAttributes,
DWORD_ dwCreationDisposition,
DWORD_ dwFlagsAndAttributes,
HANDLE_ hTemplateFile)
{
return ::CreateFileA(
lpFileName,
dwDesiredAccess,
dwShareMode,
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSecurityAttributes),
dwCreationDisposition,
dwFlagsAndAttributes,
hTemplateFile);
}
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _WIN32_FIND_DATAA {
DWORD_ dwFileAttributes;
FILETIME_ ftCreationTime;
FILETIME_ ftLastAccessTime;
FILETIME_ ftLastWriteTime;
DWORD_ nFileSizeHigh;
DWORD_ nFileSizeLow;
DWORD_ dwReserved0;
DWORD_ dwReserved1;
CHAR_ cFileName[MAX_PATH_];
CHAR_ cAlternateFileName[14];
#ifdef _MAC
DWORD_ dwFileType;
DWORD_ dwCreatorType;
WORD_ wFinderFlags;
#endif
} WIN32_FIND_DATAA_, *PWIN32_FIND_DATAA_, *LPWIN32_FIND_DATAA_;
BOOST_FORCEINLINE HANDLE_ FindFirstFileA(LPCSTR_ lpFileName, WIN32_FIND_DATAA_* lpFindFileData)
{
return ::FindFirstFileA(lpFileName, reinterpret_cast< ::_WIN32_FIND_DATAA* >(lpFindFileData));
}
BOOST_FORCEINLINE BOOL_ FindNextFileA(HANDLE_ hFindFile, WIN32_FIND_DATAA_* lpFindFileData)
{
return ::FindNextFileA(hFindFile, reinterpret_cast< ::_WIN32_FIND_DATAA* >(lpFindFileData));
}
#endif
BOOST_FORCEINLINE HANDLE_ CreateFileW(
LPCWSTR_ lpFileName,
DWORD_ dwDesiredAccess,
DWORD_ dwShareMode,
SECURITY_ATTRIBUTES_* lpSecurityAttributes,
DWORD_ dwCreationDisposition,
DWORD_ dwFlagsAndAttributes,
HANDLE_ hTemplateFile)
{
return ::CreateFileW(
lpFileName,
dwDesiredAccess,
dwShareMode,
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSecurityAttributes),
dwCreationDisposition,
dwFlagsAndAttributes,
hTemplateFile);
}
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _WIN32_FIND_DATAW {
DWORD_ dwFileAttributes;
FILETIME_ ftCreationTime;
FILETIME_ ftLastAccessTime;
FILETIME_ ftLastWriteTime;
DWORD_ nFileSizeHigh;
DWORD_ nFileSizeLow;
DWORD_ dwReserved0;
DWORD_ dwReserved1;
WCHAR_ cFileName[MAX_PATH_];
WCHAR_ cAlternateFileName[14];
#ifdef _MAC
DWORD_ dwFileType;
DWORD_ dwCreatorType;
WORD_ wFinderFlags;
#endif
} WIN32_FIND_DATAW_, *PWIN32_FIND_DATAW_, *LPWIN32_FIND_DATAW_;
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _BY_HANDLE_FILE_INFORMATION {
DWORD_ dwFileAttributes;
FILETIME_ ftCreationTime;
FILETIME_ ftLastAccessTime;
FILETIME_ ftLastWriteTime;
DWORD_ dwVolumeSerialNumber;
DWORD_ nFileSizeHigh;
DWORD_ nFileSizeLow;
DWORD_ nNumberOfLinks;
DWORD_ nFileIndexHigh;
DWORD_ nFileIndexLow;
} BY_HANDLE_FILE_INFORMATION_, *PBY_HANDLE_FILE_INFORMATION_, *LPBY_HANDLE_FILE_INFORMATION_;
BOOST_FORCEINLINE HANDLE_ FindFirstFileW(LPCWSTR_ lpFileName, WIN32_FIND_DATAW_* lpFindFileData)
{
return ::FindFirstFileW(lpFileName, reinterpret_cast< ::_WIN32_FIND_DATAW* >(lpFindFileData));
}
BOOST_FORCEINLINE BOOL_ FindNextFileW(HANDLE_ hFindFile, WIN32_FIND_DATAW_* lpFindFileData)
{
return ::FindNextFileW(hFindFile, reinterpret_cast< ::_WIN32_FIND_DATAW* >(lpFindFileData));
}
BOOST_FORCEINLINE BOOL_ GetFileSizeEx(HANDLE_ hFile, LARGE_INTEGER_* lpFileSize)
{
return ::GetFileSizeEx(hFile, reinterpret_cast< ::_LARGE_INTEGER* >(lpFileSize));
}
BOOST_FORCEINLINE BOOL_ LockFileEx(
HANDLE_ hFile,
DWORD_ dwFlags,
DWORD_ dwReserved,
DWORD_ nNumberOfBytesToLockLow,
DWORD_ nNumberOfBytesToLockHigh,
OVERLAPPED_* lpOverlapped)
{
return ::LockFileEx(hFile, dwFlags, dwReserved, nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh, reinterpret_cast< ::_OVERLAPPED* >(lpOverlapped));
}
BOOST_FORCEINLINE BOOL_ UnlockFileEx(
HANDLE_ hFile,
DWORD_ dwReserved,
DWORD_ nNumberOfBytesToUnlockLow,
DWORD_ nNumberOfBytesToUnlockHigh,
OVERLAPPED_* lpOverlapped)
{
return ::UnlockFileEx(hFile, dwReserved, nNumberOfBytesToUnlockLow, nNumberOfBytesToUnlockHigh, reinterpret_cast< ::_OVERLAPPED* >(lpOverlapped));
}
BOOST_FORCEINLINE BOOL_ ReadFile(
HANDLE_ hFile,
LPVOID_ lpBuffer,
DWORD_ nNumberOfBytesToWrite,
LPDWORD_ lpNumberOfBytesWritten,
OVERLAPPED_* lpOverlapped)
{
return ::ReadFile(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, reinterpret_cast< ::_OVERLAPPED* >(lpOverlapped));
}
BOOST_FORCEINLINE BOOL_ WriteFile(
HANDLE_ hFile,
LPCVOID_ lpBuffer,
DWORD_ nNumberOfBytesToWrite,
LPDWORD_ lpNumberOfBytesWritten,
OVERLAPPED_* lpOverlapped)
{
return ::WriteFile(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, reinterpret_cast< ::_OVERLAPPED* >(lpOverlapped));
}
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE HANDLE_ create_file(
LPCSTR_ lpFileName,
DWORD_ dwDesiredAccess,
DWORD_ dwShareMode,
SECURITY_ATTRIBUTES_* lpSecurityAttributes,
DWORD_ dwCreationDisposition,
DWORD_ dwFlagsAndAttributes,
HANDLE_ hTemplateFile)
{
return ::CreateFileA(
lpFileName,
dwDesiredAccess,
dwShareMode,
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSecurityAttributes),
dwCreationDisposition,
dwFlagsAndAttributes,
hTemplateFile);
}
BOOST_FORCEINLINE BOOL_ delete_file(LPCSTR_ lpFileName)
{
return ::DeleteFileA(lpFileName);
}
BOOST_FORCEINLINE HANDLE_ find_first_file(LPCSTR_ lpFileName, WIN32_FIND_DATAA_* lpFindFileData)
{
return ::FindFirstFileA(lpFileName, reinterpret_cast< ::_WIN32_FIND_DATAA* >(lpFindFileData));
}
BOOST_FORCEINLINE BOOL_ find_next_file(HANDLE_ hFindFile, WIN32_FIND_DATAA_* lpFindFileData)
{
return ::FindNextFileA(hFindFile, reinterpret_cast< ::_WIN32_FIND_DATAA* >(lpFindFileData));
}
BOOST_FORCEINLINE BOOL_ move_file(LPCSTR_ lpExistingFileName, LPCSTR_ lpNewFileName, DWORD_ dwFlags)
{
return ::MoveFileExA(lpExistingFileName, lpNewFileName, dwFlags);
}
BOOST_FORCEINLINE DWORD_ get_file_attributes(LPCSTR_ lpFileName)
{
return ::GetFileAttributesA(lpFileName);
}
#endif
BOOST_FORCEINLINE HANDLE_ create_file(
LPCWSTR_ lpFileName,
DWORD_ dwDesiredAccess,
DWORD_ dwShareMode,
SECURITY_ATTRIBUTES_* lpSecurityAttributes,
DWORD_ dwCreationDisposition,
DWORD_ dwFlagsAndAttributes,
HANDLE_ hTemplateFile)
{
return ::CreateFileW(
lpFileName,
dwDesiredAccess,
dwShareMode,
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSecurityAttributes),
dwCreationDisposition,
dwFlagsAndAttributes,
hTemplateFile);
}
BOOST_FORCEINLINE BOOL_ delete_file(LPCWSTR_ lpFileName)
{
return ::DeleteFileW(lpFileName);
}
BOOST_FORCEINLINE HANDLE_ find_first_file(LPCWSTR_ lpFileName, WIN32_FIND_DATAW_* lpFindFileData)
{
return ::FindFirstFileW(lpFileName, reinterpret_cast< ::_WIN32_FIND_DATAW* >(lpFindFileData));
}
BOOST_FORCEINLINE BOOL_ find_next_file(HANDLE_ hFindFile, WIN32_FIND_DATAW_* lpFindFileData)
{
return ::FindNextFileW(hFindFile, reinterpret_cast< ::_WIN32_FIND_DATAW* >(lpFindFileData));
}
BOOST_FORCEINLINE BOOL_ move_file(LPCWSTR_ lpExistingFileName, LPCWSTR_ lpNewFileName, DWORD_ dwFlags)
{
return ::MoveFileExW(lpExistingFileName, lpNewFileName, dwFlags);
}
BOOST_FORCEINLINE DWORD_ get_file_attributes(LPCWSTR_ lpFileName)
{
return ::GetFileAttributesW(lpFileName);
}
BOOST_FORCEINLINE BOOL_ GetFileInformationByHandle(HANDLE_ h, BY_HANDLE_FILE_INFORMATION_* info)
{
return ::GetFileInformationByHandle(h, reinterpret_cast< ::_BY_HANDLE_FILE_INFORMATION* >(info));
}
}
}
}
#endif // BOOST_DETAIL_WINAPI_FILE_MANAGEMENT_HPP
@@ -0,0 +1,238 @@
// file_mapping.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Copyright 2016 Jorge Lodos
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_FILE_MAPPING_HPP
#define BOOST_DETAIL_WINAPI_FILE_MAPPING_HPP
#include <boost/detail/winapi/basic_types.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
CreateFileMappingA(
boost::detail::winapi::HANDLE_ hFile,
::_SECURITY_ATTRIBUTES* lpFileMappingAttributes,
boost::detail::winapi::DWORD_ flProtect,
boost::detail::winapi::DWORD_ dwMaximumSizeHigh,
boost::detail::winapi::DWORD_ dwMaximumSizeLow,
boost::detail::winapi::LPCSTR_ lpName);
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
OpenFileMappingA(
boost::detail::winapi::DWORD_ dwDesiredAccess,
boost::detail::winapi::BOOL_ bInheritHandle,
boost::detail::winapi::LPCSTR_ lpName);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
CreateFileMappingW(
boost::detail::winapi::HANDLE_ hFile,
::_SECURITY_ATTRIBUTES* lpFileMappingAttributes,
boost::detail::winapi::DWORD_ flProtect,
boost::detail::winapi::DWORD_ dwMaximumSizeHigh,
boost::detail::winapi::DWORD_ dwMaximumSizeLow,
boost::detail::winapi::LPCWSTR_ lpName);
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
OpenFileMappingW(
boost::detail::winapi::DWORD_ dwDesiredAccess,
boost::detail::winapi::BOOL_ bInheritHandle,
boost::detail::winapi::LPCWSTR_ lpName);
BOOST_SYMBOL_IMPORT boost::detail::winapi::LPVOID_ WINAPI
MapViewOfFile(
boost::detail::winapi::HANDLE_ hFileMappingObject,
boost::detail::winapi::DWORD_ dwDesiredAccess,
boost::detail::winapi::DWORD_ dwFileOffsetHigh,
boost::detail::winapi::DWORD_ dwFileOffsetLow,
boost::detail::winapi::SIZE_T_ dwNumberOfBytesToMap);
BOOST_SYMBOL_IMPORT boost::detail::winapi::LPVOID_ WINAPI
MapViewOfFileEx(
boost::detail::winapi::HANDLE_ hFileMappingObject,
boost::detail::winapi::DWORD_ dwDesiredAccess,
boost::detail::winapi::DWORD_ dwFileOffsetHigh,
boost::detail::winapi::DWORD_ dwFileOffsetLow,
boost::detail::winapi::SIZE_T_ dwNumberOfBytesToMap,
boost::detail::winapi::LPVOID_ lpBaseAddress);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
FlushViewOfFile(
boost::detail::winapi::LPCVOID_ lpBaseAddress,
boost::detail::winapi::SIZE_T_ dwNumberOfBytesToFlush);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
UnmapViewOfFile(boost::detail::winapi::LPCVOID_ lpBaseAddress);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
#if defined( BOOST_USE_WINDOWS_H )
const DWORD_ SEC_FILE_ = SEC_FILE;
const DWORD_ SEC_IMAGE_ = SEC_IMAGE;
const DWORD_ SEC_RESERVE_ = SEC_RESERVE;
const DWORD_ SEC_COMMIT_ = SEC_COMMIT;
const DWORD_ SEC_NOCACHE_ = SEC_NOCACHE;
// These permission flags are undocumented and some of them are equivalent to the FILE_MAP_* flags.
// SECTION_QUERY enables NtQuerySection.
// http://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FNT%20Objects%2FSection%2FNtQuerySection.html
const DWORD_ SECTION_QUERY_ = SECTION_QUERY;
const DWORD_ SECTION_MAP_WRITE_ = SECTION_MAP_WRITE;
const DWORD_ SECTION_MAP_READ_ = SECTION_MAP_READ;
const DWORD_ SECTION_MAP_EXECUTE_ = SECTION_MAP_EXECUTE;
const DWORD_ SECTION_EXTEND_SIZE_ = SECTION_EXTEND_SIZE;
const DWORD_ SECTION_ALL_ACCESS_ = SECTION_ALL_ACCESS;
const DWORD_ FILE_MAP_COPY_ = FILE_MAP_COPY;
const DWORD_ FILE_MAP_WRITE_ = FILE_MAP_WRITE;
const DWORD_ FILE_MAP_READ_ = FILE_MAP_READ;
const DWORD_ FILE_MAP_ALL_ACCESS_ = FILE_MAP_ALL_ACCESS;
#else // defined( BOOST_USE_WINDOWS_H )
const DWORD_ SEC_FILE_ = 0x800000;
const DWORD_ SEC_IMAGE_ = 0x1000000;
const DWORD_ SEC_RESERVE_ = 0x4000000;
const DWORD_ SEC_COMMIT_ = 0x8000000;
const DWORD_ SEC_NOCACHE_ = 0x10000000;
// These permission flags are undocumented and some of them are equivalent to the FILE_MAP_* flags.
// SECTION_QUERY enables NtQuerySection.
// http://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FNT%20Objects%2FSection%2FNtQuerySection.html
const DWORD_ SECTION_QUERY_ = 0x00000001;
const DWORD_ SECTION_MAP_WRITE_ = 0x00000002;
const DWORD_ SECTION_MAP_READ_ = 0x00000004;
const DWORD_ SECTION_MAP_EXECUTE_ = 0x00000008;
const DWORD_ SECTION_EXTEND_SIZE_ = 0x00000010;
const DWORD_ SECTION_ALL_ACCESS_ = 0x000F001F; // STANDARD_RIGHTS_REQUIRED | SECTION_*
const DWORD_ FILE_MAP_COPY_ = SECTION_QUERY_;
const DWORD_ FILE_MAP_WRITE_ = SECTION_MAP_WRITE_;
const DWORD_ FILE_MAP_READ_ = SECTION_MAP_READ_;
const DWORD_ FILE_MAP_ALL_ACCESS_ = SECTION_ALL_ACCESS_;
#endif // defined( BOOST_USE_WINDOWS_H )
// These constants are not defined in Windows SDK up until the one shipped with MSVC 8 and MinGW (as of 2016-02-14)
const DWORD_ SECTION_MAP_EXECUTE_EXPLICIT_ = 0x00000020; // not included in SECTION_ALL_ACCESS
const DWORD_ FILE_MAP_EXECUTE_ = SECTION_MAP_EXECUTE_EXPLICIT_; // not included in FILE_MAP_ALL_ACCESS
// These constants are not defined in Windows SDK up until 6.0A and MinGW (as of 2016-02-14)
const DWORD_ SEC_PROTECTED_IMAGE_ = 0x2000000;
const DWORD_ SEC_WRITECOMBINE_ = 0x40000000;
const DWORD_ SEC_LARGE_PAGES_ = 0x80000000;
const DWORD_ SEC_IMAGE_NO_EXECUTE_ = (SEC_IMAGE_ | SEC_NOCACHE_);
#if !defined( BOOST_NO_ANSI_APIS )
using ::OpenFileMappingA;
#endif
using ::OpenFileMappingW;
using ::MapViewOfFile;
using ::MapViewOfFileEx;
using ::FlushViewOfFile;
using ::UnmapViewOfFile;
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE HANDLE_ CreateFileMappingA(
HANDLE_ hFile,
SECURITY_ATTRIBUTES_* lpFileMappingAttributes,
DWORD_ flProtect,
DWORD_ dwMaximumSizeHigh,
DWORD_ dwMaximumSizeLow,
LPCSTR_ lpName)
{
return ::CreateFileMappingA(
hFile,
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpFileMappingAttributes),
flProtect,
dwMaximumSizeHigh,
dwMaximumSizeLow,
lpName);
}
#endif
BOOST_FORCEINLINE HANDLE_ CreateFileMappingW(
HANDLE_ hFile,
SECURITY_ATTRIBUTES_* lpFileMappingAttributes,
DWORD_ flProtect,
DWORD_ dwMaximumSizeHigh,
DWORD_ dwMaximumSizeLow,
LPCWSTR_ lpName)
{
return ::CreateFileMappingW(
hFile,
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpFileMappingAttributes),
flProtect,
dwMaximumSizeHigh,
dwMaximumSizeLow,
lpName);
}
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE HANDLE_ create_file_mapping(
HANDLE_ hFile,
SECURITY_ATTRIBUTES_* lpFileMappingAttributes,
DWORD_ flProtect,
DWORD_ dwMaximumSizeHigh,
DWORD_ dwMaximumSizeLow,
LPCSTR_ lpName)
{
return ::CreateFileMappingA(
hFile,
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpFileMappingAttributes),
flProtect,
dwMaximumSizeHigh,
dwMaximumSizeLow,
lpName);
}
BOOST_FORCEINLINE HANDLE_ open_file_mapping(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCSTR_ lpName)
{
return ::OpenFileMappingA(dwDesiredAccess, bInheritHandle, lpName);
}
#endif
BOOST_FORCEINLINE HANDLE_ create_file_mapping(
HANDLE_ hFile,
SECURITY_ATTRIBUTES_* lpFileMappingAttributes,
DWORD_ flProtect,
DWORD_ dwMaximumSizeHigh,
DWORD_ dwMaximumSizeLow,
LPCWSTR_ lpName)
{
return ::CreateFileMappingW(
hFile,
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpFileMappingAttributes),
flProtect,
dwMaximumSizeHigh,
dwMaximumSizeLow,
lpName);
}
BOOST_FORCEINLINE HANDLE_ open_file_mapping(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCWSTR_ lpName)
{
return ::OpenFileMappingW(dwDesiredAccess, bInheritHandle, lpName);
}
}
}
}
#endif // BOOST_DETAIL_WINAPI_FILE_MAPPING_HPP
@@ -0,0 +1,34 @@
// get_current_process.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_GET_CURRENT_PROCESS_HPP
#define BOOST_DETAIL_WINAPI_GET_CURRENT_PROCESS_HPP
#include <boost/detail/winapi/basic_types.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
// Windows CE define GetCurrentProcess as an inline function in kfuncs.h
#if !defined( BOOST_USE_WINDOWS_H ) && !defined( UNDER_CE )
extern "C" {
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI GetCurrentProcess(BOOST_DETAIL_WINAPI_VOID);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
using ::GetCurrentProcess;
}
}
}
#endif // BOOST_DETAIL_WINAPI_GET_CURRENT_PROCESS_HPP
@@ -0,0 +1,33 @@
// get_current_process_id.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_GET_CURRENT_PROCESS_ID_HPP
#define BOOST_DETAIL_WINAPI_GET_CURRENT_PROCESS_ID_HPP
#include <boost/detail/winapi/basic_types.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
// Windows CE define GetCurrentProcessId as an inline function in kfuncs.h
#if !defined( BOOST_USE_WINDOWS_H ) && !defined( UNDER_CE )
extern "C" {
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI GetCurrentProcessId(BOOST_DETAIL_WINAPI_VOID);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
using ::GetCurrentProcessId;
}
}
}
#endif // BOOST_DETAIL_WINAPI_GET_CURRENT_PROCESS_ID_HPP
@@ -0,0 +1,34 @@
// get_current_thread.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_GET_CURRENT_THREAD_HPP
#define BOOST_DETAIL_WINAPI_GET_CURRENT_THREAD_HPP
#include <boost/detail/winapi/basic_types.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
// Windows CE define GetCurrentThread as an inline function in kfuncs.h
#if !defined( BOOST_USE_WINDOWS_H ) && !defined( UNDER_CE )
extern "C" {
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI GetCurrentThread(BOOST_DETAIL_WINAPI_VOID);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
using ::GetCurrentThread;
}
}
}
#endif // BOOST_DETAIL_WINAPI_GET_CURRENT_THREAD_HPP
@@ -0,0 +1,34 @@
// get_current_thread_id.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_GET_CURRENT_THREAD_ID_HPP
#define BOOST_DETAIL_WINAPI_GET_CURRENT_THREAD_ID_HPP
#include <boost/detail/winapi/basic_types.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
// Windows CE define GetCurrentThreadId as an inline function in kfuncs.h
#if !defined( BOOST_USE_WINDOWS_H ) && !defined( UNDER_CE )
extern "C" {
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI GetCurrentThreadId(BOOST_DETAIL_WINAPI_VOID);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
using ::GetCurrentThreadId;
}
}
}
#endif // BOOST_DETAIL_WINAPI_GET_CURRENT_THREAD_ID_HPP
@@ -0,0 +1,33 @@
// get_last_error.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_GET_LAST_ERROR_HPP
#define BOOST_DETAIL_WINAPI_GET_LAST_ERROR_HPP
#include <boost/detail/winapi/basic_types.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI GetLastError(BOOST_DETAIL_WINAPI_VOID);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
using ::GetLastError;
}
}
}
#endif // BOOST_DETAIL_WINAPI_GET_LAST_ERROR_HPP
@@ -0,0 +1,60 @@
// get_process_times.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_GET_PROCESS_TIMES_HPP
#define BOOST_DETAIL_WINAPI_GET_PROCESS_TIMES_HPP
#include <boost/detail/winapi/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
// Windows CE does not define GetProcessTimes
#if !defined( UNDER_CE )
#include <boost/detail/winapi/basic_types.hpp>
#include <boost/detail/winapi/time.hpp>
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
GetProcessTimes(
boost::detail::winapi::HANDLE_ hProcess,
::_FILETIME* lpCreationTime,
::_FILETIME* lpExitTime,
::_FILETIME* lpKernelTime,
::_FILETIME* lpUserTime);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
BOOST_FORCEINLINE BOOL_ GetProcessTimes(
HANDLE_ hProcess,
LPFILETIME_ lpCreationTime,
LPFILETIME_ lpExitTime,
LPFILETIME_ lpKernelTime,
LPFILETIME_ lpUserTime)
{
return ::GetProcessTimes(
hProcess,
reinterpret_cast< ::_FILETIME* >(lpCreationTime),
reinterpret_cast< ::_FILETIME* >(lpExitTime),
reinterpret_cast< ::_FILETIME* >(lpKernelTime),
reinterpret_cast< ::_FILETIME* >(lpUserTime));
}
}
}
}
#endif // !defined( UNDER_CE )
#endif // BOOST_DETAIL_WINAPI_GET_PROCESS_TIMES_HPP
@@ -0,0 +1,63 @@
// get_system_directory.hpp --------------------------------------------------------------//
// Copyright 2016 Klemens D. Morgenstern
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_GET_SYSTEM_DIRECTORY_HPP_
#define BOOST_DETAIL_WINAPI_GET_SYSTEM_DIRECTORY_HPP_
#include <boost/detail/winapi/basic_types.hpp>
#include <boost/predef/platform.h>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if BOOST_PLAT_WINDOWS_DESKTOP
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_SYMBOL_IMPORT boost::detail::winapi::UINT_ WINAPI
GetSystemDirectoryA(
boost::detail::winapi::LPSTR_ lpBuffer,
boost::detail::winapi::UINT_ uSize);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::UINT_ WINAPI
GetSystemDirectoryW(
boost::detail::winapi::LPWSTR_ lpBuffer,
boost::detail::winapi::UINT_ uSize);
} // extern "C"
#endif
namespace boost {
namespace detail {
namespace winapi {
#if !defined( BOOST_NO_ANSI_APIS )
using ::GetSystemDirectoryA;
#endif
using ::GetSystemDirectoryW;
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE UINT_ get_system_directory(LPSTR_ lpBuffer, UINT_ uSize)
{
return ::GetSystemDirectoryA(lpBuffer, uSize);
}
#endif
BOOST_FORCEINLINE UINT_ get_system_directory(LPWSTR_ lpBuffer, UINT_ uSize)
{
return ::GetSystemDirectoryW(lpBuffer, uSize);
}
}
}
}
#endif // BOOST_PLAT_WINDOWS_DESKTOP
#endif // BOOST_DETAIL_WINAPI_GET_SYSTEM_DIRECTORY_HPP_
@@ -0,0 +1,55 @@
// get_thread_times.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_GET_THREAD_TIMES_HPP
#define BOOST_DETAIL_WINAPI_GET_THREAD_TIMES_HPP
#include <boost/detail/winapi/basic_types.hpp>
#include <boost/detail/winapi/time.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
GetThreadTimes(
boost::detail::winapi::HANDLE_ hThread,
::_FILETIME* lpCreationTime,
::_FILETIME* lpExitTime,
::_FILETIME* lpKernelTime,
::_FILETIME* lpUserTime);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
BOOST_FORCEINLINE BOOL_ GetThreadTimes(
HANDLE_ hThread,
LPFILETIME_ lpCreationTime,
LPFILETIME_ lpExitTime,
LPFILETIME_ lpKernelTime,
LPFILETIME_ lpUserTime)
{
return ::GetThreadTimes(
hThread,
reinterpret_cast< ::_FILETIME* >(lpCreationTime),
reinterpret_cast< ::_FILETIME* >(lpExitTime),
reinterpret_cast< ::_FILETIME* >(lpKernelTime),
reinterpret_cast< ::_FILETIME* >(lpUserTime));
}
}
}
}
#endif // BOOST_DETAIL_WINAPI_GET_THREAD_TIMES_HPP
@@ -0,0 +1,62 @@
// handle_info.hpp --------------------------------------------------------------//
// Copyright 2016 Klemens D. Morgenstern
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_HANDLE_INFO_HPP_
#define BOOST_DETAIL_HANDLE_INFO_HPP_
#include <boost/detail/winapi/basic_types.hpp>
#include <boost/predef/platform.h>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if BOOST_PLAT_WINDOWS_DESKTOP
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
GetHandleInformation(
boost::detail::winapi::HANDLE_ hObject,
boost::detail::winapi::LPDWORD_ lpdwFlags);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
SetHandleInformation(
boost::detail::winapi::HANDLE_ hObject,
boost::detail::winapi::DWORD_ dwMask,
boost::detail::winapi::DWORD_ dwFlags);
} // extern "C"
#endif
namespace boost {
namespace detail {
namespace winapi {
using ::GetHandleInformation;
using ::SetHandleInformation;
#if defined( BOOST_USE_WINDOWS_H )
const DWORD_ HANDLE_FLAG_INHERIT_ = HANDLE_FLAG_INHERIT;
const DWORD_ HANDLE_FLAG_PROTECT_FROM_CLOSE_ = HANDLE_FLAG_PROTECT_FROM_CLOSE;
#else
const DWORD_ HANDLE_FLAG_INHERIT_ = 0x1;
const DWORD_ HANDLE_FLAG_PROTECT_FROM_CLOSE_ = 0x2;
#endif
}
}
}
#endif // BOOST_PLAT_WINDOWS_DESKTOP
#endif // BOOST_DETAIL_HANDLE_INFO_HPP_
@@ -0,0 +1,73 @@
// handles.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_HANDLES_HPP
#define BOOST_DETAIL_WINAPI_HANDLES_HPP
#include <boost/detail/winapi/basic_types.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
CloseHandle(boost::detail::winapi::HANDLE_ handle);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
DuplicateHandle(
boost::detail::winapi::HANDLE_ hSourceProcessHandle,
boost::detail::winapi::HANDLE_ hSourceHandle,
boost::detail::winapi::HANDLE_ hTargetProcessHandle,
boost::detail::winapi::HANDLE_* lpTargetHandle,
boost::detail::winapi::DWORD_ dwDesiredAccess,
boost::detail::winapi::BOOL_ bInheritHandle,
boost::detail::winapi::DWORD_ dwOptions);
}
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN10
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
CompareObjectHandles(
boost::detail::winapi::HANDLE_ hFirstObjectHandle,
boost::detail::winapi::HANDLE_ hSecondObjectHandle);
#endif
#endif
namespace boost {
namespace detail {
namespace winapi {
using ::CloseHandle;
using ::DuplicateHandle;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN10
using ::CompareObjectHandles;
#endif
#if defined( BOOST_USE_WINDOWS_H )
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
const DWORD_ DUPLICATE_CLOSE_SOURCE_ = 1;
const DWORD_ DUPLICATE_SAME_ACCESS_ = 2;
const HANDLE_ INVALID_HANDLE_VALUE_ = (HANDLE_)(-1);
#endif
const DWORD_ duplicate_close_source = DUPLICATE_CLOSE_SOURCE_;
const DWORD_ duplicate_same_access = DUPLICATE_SAME_ACCESS_;
const HANDLE_ invalid_handle_value = INVALID_HANDLE_VALUE_;
}
}
}
#endif // BOOST_DETAIL_WINAPI_HANDLES_HPP
@@ -0,0 +1,72 @@
// heap_memory.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_HEAP_MEMORY_HPP
#define BOOST_DETAIL_WINAPI_HEAP_MEMORY_HPP
#include <boost/detail/winapi/basic_types.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
#undef HeapAlloc
extern "C" {
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
GetProcessHeap(BOOST_DETAIL_WINAPI_VOID);
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
GetProcessHeaps(boost::detail::winapi::DWORD_ NumberOfHeaps, boost::detail::winapi::PHANDLE_ ProcessHeaps);
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
HeapCreate(
boost::detail::winapi::DWORD_ flOptions,
boost::detail::winapi::SIZE_T_ dwInitialSize,
boost::detail::winapi::SIZE_T_ dwMaximumSize);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
HeapDestroy(boost::detail::winapi::HANDLE_ hHeap);
BOOST_SYMBOL_IMPORT boost::detail::winapi::LPVOID_ WINAPI
HeapAlloc(
boost::detail::winapi::HANDLE_ hHeap,
boost::detail::winapi::DWORD_ dwFlags,
boost::detail::winapi::SIZE_T_ dwBytes);
BOOST_SYMBOL_IMPORT boost::detail::winapi::LPVOID_ WINAPI
HeapReAlloc(
boost::detail::winapi::HANDLE_ hHeap,
boost::detail::winapi::DWORD_ dwFlags,
boost::detail::winapi::LPVOID_ lpMem,
boost::detail::winapi::SIZE_T_ dwBytes);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
HeapFree(
boost::detail::winapi::HANDLE_ hHeap,
boost::detail::winapi::DWORD_ dwFlags,
boost::detail::winapi::LPVOID_ lpMem);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
using ::GetProcessHeap;
using ::GetProcessHeaps;
using ::HeapCreate;
using ::HeapDestroy;
using ::HeapAlloc;
using ::HeapReAlloc;
using ::HeapFree;
}
}
}
#endif // BOOST_DETAIL_WINAPI_HEAP_MEMORY_HPP
@@ -0,0 +1,123 @@
// init_once.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_INIT_ONCE_HPP
#define BOOST_DETAIL_WINAPI_INIT_ONCE_HPP
#include <boost/detail/winapi/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
#include <boost/detail/winapi/basic_types.hpp>
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
#if defined( BOOST_WINAPI_IS_MINGW_W64 )
struct _RTL_RUN_ONCE;
#else
union _RTL_RUN_ONCE;
#endif
typedef boost::detail::winapi::BOOL_
(WINAPI *PINIT_ONCE_FN) (
::_RTL_RUN_ONCE* InitOnce,
boost::detail::winapi::PVOID_ Parameter,
boost::detail::winapi::PVOID_ *Context);
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
InitOnceInitialize(::_RTL_RUN_ONCE* InitOnce);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
InitOnceExecuteOnce(
::_RTL_RUN_ONCE* InitOnce,
::PINIT_ONCE_FN InitFn,
boost::detail::winapi::PVOID_ Parameter,
boost::detail::winapi::LPVOID_ *Context);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
InitOnceBeginInitialize(
::_RTL_RUN_ONCE* lpInitOnce,
boost::detail::winapi::DWORD_ dwFlags,
boost::detail::winapi::PBOOL_ fPending,
boost::detail::winapi::LPVOID_ *lpContext);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
InitOnceComplete(
::_RTL_RUN_ONCE* lpInitOnce,
boost::detail::winapi::DWORD_ dwFlags,
boost::detail::winapi::LPVOID_ lpContext);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
typedef union BOOST_DETAIL_WINAPI_MAY_ALIAS _RTL_RUN_ONCE {
PVOID_ Ptr;
} INIT_ONCE_, *PINIT_ONCE_, *LPINIT_ONCE_;
extern "C" {
typedef BOOL_ (WINAPI *PINIT_ONCE_FN_) (PINIT_ONCE_ lpInitOnce, PVOID_ Parameter, PVOID_ *Context);
}
BOOST_FORCEINLINE VOID_ InitOnceInitialize(PINIT_ONCE_ lpInitOnce)
{
::InitOnceInitialize(reinterpret_cast< ::_RTL_RUN_ONCE* >(lpInitOnce));
}
BOOST_FORCEINLINE BOOL_ InitOnceExecuteOnce(PINIT_ONCE_ lpInitOnce, PINIT_ONCE_FN_ InitFn, PVOID_ Parameter, LPVOID_ *Context)
{
return ::InitOnceExecuteOnce(reinterpret_cast< ::_RTL_RUN_ONCE* >(lpInitOnce), reinterpret_cast< ::PINIT_ONCE_FN >(InitFn), Parameter, Context);
}
BOOST_FORCEINLINE BOOL_ InitOnceBeginInitialize(PINIT_ONCE_ lpInitOnce, DWORD_ dwFlags, PBOOL_ fPending, LPVOID_ *lpContext)
{
return ::InitOnceBeginInitialize(reinterpret_cast< ::_RTL_RUN_ONCE* >(lpInitOnce), dwFlags, fPending, lpContext);
}
BOOST_FORCEINLINE BOOL_ InitOnceComplete(PINIT_ONCE_ lpInitOnce, DWORD_ dwFlags, LPVOID_ lpContext)
{
return ::InitOnceComplete(reinterpret_cast< ::_RTL_RUN_ONCE* >(lpInitOnce), dwFlags, lpContext);
}
#if defined( BOOST_USE_WINDOWS_H )
#define BOOST_DETAIL_WINAPI_INIT_ONCE_STATIC_INIT INIT_ONCE_STATIC_INIT
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;
#else // defined( BOOST_USE_WINDOWS_H )
#define BOOST_DETAIL_WINAPI_INIT_ONCE_STATIC_INIT {0}
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;
#endif // defined( BOOST_USE_WINDOWS_H )
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_;
}
}
}
#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
#endif // BOOST_DETAIL_WINAPI_INIT_ONCE_HPP
@@ -0,0 +1,119 @@
// jobs.hpp --------------------------------------------------------------//
// Copyright 2016 Klemens D. Morgenstern
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_JOBS_HPP_
#define BOOST_DETAIL_WINAPI_JOBS_HPP_
#include <boost/detail/winapi/basic_types.hpp>
#include <boost/detail/winapi/access_rights.hpp>
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI CreateJobObjectA(
::_SECURITY_ATTRIBUTES* lpJobAttributes,
boost::detail::winapi::LPCSTR_ lpName);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI CreateJobObjectW(
::_SECURITY_ATTRIBUTES* lpJobAttributes,
boost::detail::winapi::LPCWSTR_ lpName);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI AssignProcessToJobObject(
boost::detail::winapi::HANDLE_ hJob,
boost::detail::winapi::HANDLE_ hProcess);
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WINXP
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI IsProcessInJob(
boost::detail::winapi::HANDLE_ ProcessHandle,
boost::detail::winapi::HANDLE_ JobHandle,
boost::detail::winapi::PBOOL_ Result);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI TerminateJobObject(
boost::detail::winapi::HANDLE_ hJob,
boost::detail::winapi::UINT_ uExitCode);
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI OpenJobObjectA(
boost::detail::winapi::DWORD_ dwDesiredAccess,
boost::detail::winapi::BOOL_ bInheritHandles,
boost::detail::winapi::LPCSTR_ lpName);
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI OpenJobObjectW(
boost::detail::winapi::DWORD_ dwDesiredAccess,
boost::detail::winapi::BOOL_ bInheritHandles,
boost::detail::winapi::LPCWSTR_ lpName);
} // extern "C"
#endif // !defined( BOOST_USE_WINDOWS_H )
namespace boost { namespace detail { namespace winapi {
#if defined( BOOST_USE_WINDOWS_H )
const DWORD_ JOB_OBJECT_ASSIGN_PROCESS_ = JOB_OBJECT_ASSIGN_PROCESS;
const DWORD_ JOB_OBJECT_SET_ATTRIBUTES_ = JOB_OBJECT_SET_ATTRIBUTES;
const DWORD_ JOB_OBJECT_QUERY_ = JOB_OBJECT_QUERY;
const DWORD_ JOB_OBJECT_TERMINATE_ = JOB_OBJECT_TERMINATE;
const DWORD_ JOB_OBJECT_SET_SECURITY_ATTRIBUTES_ = JOB_OBJECT_SET_SECURITY_ATTRIBUTES;
const DWORD_ JOB_OBJECT_ALL_ACCESS_ = JOB_OBJECT_ALL_ACCESS;
#else
const DWORD_ JOB_OBJECT_ASSIGN_PROCESS_ = 0x0001;
const DWORD_ JOB_OBJECT_SET_ATTRIBUTES_ = 0x0002;
const DWORD_ JOB_OBJECT_QUERY_ = 0x0004;
const DWORD_ JOB_OBJECT_TERMINATE_ = 0x0008;
const DWORD_ JOB_OBJECT_SET_SECURITY_ATTRIBUTES_ = 0x0010;
const DWORD_ JOB_OBJECT_ALL_ACCESS_ = (STANDARD_RIGHTS_REQUIRED_ | SYNCHRONIZE_ | 0x1F);
#endif
#if !defined( BOOST_NO_ANSI_APIS )
using ::OpenJobObjectA;
#endif
using ::OpenJobObjectW;
using ::AssignProcessToJobObject;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WINXP
using ::IsProcessInJob;
#endif
using ::TerminateJobObject;
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE HANDLE_ CreateJobObjectA(LPSECURITY_ATTRIBUTES_ lpJobAttributes, LPCSTR_ lpName)
{
return ::CreateJobObjectA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpJobAttributes), lpName);
}
BOOST_FORCEINLINE HANDLE_ create_job_object(LPSECURITY_ATTRIBUTES_ lpJobAttributes, LPCSTR_ lpName)
{
return ::CreateJobObjectA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpJobAttributes), lpName);
}
BOOST_FORCEINLINE HANDLE_ open_job_object(DWORD_ dwDesiredAccess, BOOL_ bInheritHandles, LPCSTR_ lpName)
{
return ::OpenJobObjectA(dwDesiredAccess, bInheritHandles, lpName);
}
#endif // !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE HANDLE_ CreateJobObjectW(LPSECURITY_ATTRIBUTES_ lpJobAttributes, LPCWSTR_ lpName)
{
return ::CreateJobObjectW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpJobAttributes), lpName);
}
BOOST_FORCEINLINE HANDLE_ create_job_object(LPSECURITY_ATTRIBUTES_ lpJobAttributes, LPCWSTR_ lpName)
{
return ::CreateJobObjectW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpJobAttributes), lpName);
}
BOOST_FORCEINLINE HANDLE_ open_job_object(DWORD_ dwDesiredAccess, BOOL_ bInheritHandles, LPCWSTR_ lpName)
{
return OpenJobObjectW(dwDesiredAccess, bInheritHandles, lpName);
}
} // namespace winapi
} // namespace detail
} // namespace boost
#endif // BOOST_DETAIL_WINAPI_JOBS_HPP_
@@ -0,0 +1,51 @@
// limits.hpp --------------------------------------------------------------//
// Copyright 2016 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_LIMITS_HPP_
#define BOOST_DETAIL_WINAPI_LIMITS_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 )
const DWORD_ MAX_PATH_ = MAX_PATH;
#else
const DWORD_ MAX_PATH_ = 260;
#endif
#if defined( BOOST_USE_WINDOWS_H ) && !defined( BOOST_WINAPI_IS_MINGW )
const DWORD_ UNICODE_STRING_MAX_BYTES_ = UNICODE_STRING_MAX_BYTES;
const DWORD_ UNICODE_STRING_MAX_CHARS_ = UNICODE_STRING_MAX_CHARS;
#else
const DWORD_ UNICODE_STRING_MAX_BYTES_ = 65534;
const DWORD_ UNICODE_STRING_MAX_CHARS_ = 32767;
#endif
const DWORD_ max_path = MAX_PATH_;
const DWORD_ unicode_string_max_bytes = UNICODE_STRING_MAX_BYTES_;
const DWORD_ unicode_string_max_chars = UNICODE_STRING_MAX_CHARS_;
}
}
}
#endif // BOOST_DETAIL_WINAPI_LIMITS_HPP_
@@ -0,0 +1,51 @@
// local_memory.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_LOCAL_MEMORY_HPP
#define BOOST_DETAIL_WINAPI_LOCAL_MEMORY_HPP
#include <boost/detail/winapi/basic_types.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
namespace boost { namespace detail { namespace winapi {
typedef HANDLE_ HLOCAL_;
}}}
extern "C" {
BOOST_SYMBOL_IMPORT boost::detail::winapi::HLOCAL_ WINAPI
LocalAlloc(
boost::detail::winapi::UINT_ uFlags,
boost::detail::winapi::SIZE_T_ uBytes);
BOOST_SYMBOL_IMPORT boost::detail::winapi::HLOCAL_ WINAPI
LocalReAlloc(
boost::detail::winapi::HLOCAL_ hMem,
boost::detail::winapi::SIZE_T_ uBytes,
boost::detail::winapi::UINT_ uFlags);
BOOST_SYMBOL_IMPORT boost::detail::winapi::HLOCAL_ WINAPI LocalFree(boost::detail::winapi::HLOCAL_ hMem);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
#if defined( BOOST_USE_WINDOWS_H )
typedef ::HLOCAL HLOCAL_;
#endif
using ::LocalAlloc;
using ::LocalReAlloc;
using ::LocalFree;
}
}
}
#endif // BOOST_DETAIL_WINAPI_LOCAL_MEMORY_HPP
@@ -0,0 +1,20 @@
// memory.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_MEMORY_HPP
#define BOOST_DETAIL_WINAPI_MEMORY_HPP
#include <boost/detail/winapi/heap_memory.hpp>
#include <boost/detail/winapi/local_memory.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#endif // BOOST_DETAIL_WINAPI_MEMORY_HPP
@@ -0,0 +1,184 @@
// mutex.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_MUTEX_HPP
#define BOOST_DETAIL_WINAPI_MUTEX_HPP
#include <boost/detail/winapi/basic_types.hpp>
#include <boost/predef/platform.h>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
#if !defined( BOOST_NO_ANSI_APIS )
#if !defined( BOOST_PLAT_WINDOWS_RUNTIME_AVALIABLE )
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
CreateMutexA(
::_SECURITY_ATTRIBUTES* lpMutexAttributes,
boost::detail::winapi::BOOL_ bInitialOwner,
boost::detail::winapi::LPCSTR_ lpName);
#endif
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
CreateMutexExA(
::_SECURITY_ATTRIBUTES* lpMutexAttributes,
boost::detail::winapi::LPCSTR_ lpName,
boost::detail::winapi::DWORD_ dwFlags,
boost::detail::winapi::DWORD_ dwDesiredAccess);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
OpenMutexA(
boost::detail::winapi::DWORD_ dwDesiredAccess,
boost::detail::winapi::BOOL_ bInheritHandle,
boost::detail::winapi::LPCSTR_ lpName);
#endif
#if !defined( BOOST_PLAT_WINDOWS_RUNTIME_AVALIABLE )
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
CreateMutexW(
::_SECURITY_ATTRIBUTES* lpMutexAttributes,
boost::detail::winapi::BOOL_ bInitialOwner,
boost::detail::winapi::LPCWSTR_ lpName);
#endif
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
CreateMutexExW(
::_SECURITY_ATTRIBUTES* lpMutexAttributes,
boost::detail::winapi::LPCWSTR_ lpName,
boost::detail::winapi::DWORD_ dwFlags,
boost::detail::winapi::DWORD_ dwDesiredAccess);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
OpenMutexW(
boost::detail::winapi::DWORD_ dwDesiredAccess,
boost::detail::winapi::BOOL_ bInheritHandle,
boost::detail::winapi::LPCWSTR_ lpName);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
ReleaseMutex(boost::detail::winapi::HANDLE_ hMutex);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
#if !defined( BOOST_NO_ANSI_APIS )
using ::OpenMutexA;
#endif
using ::OpenMutexW;
using ::ReleaseMutex;
#if defined( BOOST_USE_WINDOWS_H )
const DWORD_ MUTEX_ALL_ACCESS_ = MUTEX_ALL_ACCESS;
const DWORD_ MUTEX_MODIFY_STATE_ = MUTEX_MODIFY_STATE;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
const DWORD_ CREATE_MUTEX_INITIAL_OWNER_ = CREATE_MUTEX_INITIAL_OWNER;
#endif
#else // defined( BOOST_USE_WINDOWS_H )
const DWORD_ MUTEX_ALL_ACCESS_ = 0x001F0001;
const DWORD_ MUTEX_MODIFY_STATE_ = 0x00000001;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
const DWORD_ CREATE_MUTEX_INITIAL_OWNER_ = 0x00000001;
#endif
#endif // defined( BOOST_USE_WINDOWS_H )
const DWORD_ mutex_all_access = MUTEX_ALL_ACCESS_;
const DWORD_ mutex_modify_state = MUTEX_MODIFY_STATE_;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
const DWORD_ create_mutex_initial_owner = CREATE_MUTEX_INITIAL_OWNER_;
#endif
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE HANDLE_ CreateMutexA(SECURITY_ATTRIBUTES_* lpMutexAttributes, BOOL_ bInitialOwner, LPCSTR_ lpName)
{
#if BOOST_PLAT_WINDOWS_RUNTIME && BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
const DWORD_ flags = bInitialOwner ? create_mutex_initial_owner : 0u;
return ::CreateMutexExA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpMutexAttributes), lpName, flags, mutex_all_access);
#else
return ::CreateMutexA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpMutexAttributes), bInitialOwner, lpName);
#endif
}
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
BOOST_FORCEINLINE HANDLE_ CreateMutexExA(
SECURITY_ATTRIBUTES_* lpMutexAttributes,
LPCSTR_ lpName,
DWORD_ dwFlags,
DWORD_ dwDesiredAccess)
{
return ::CreateMutexExA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpMutexAttributes), lpName, dwFlags, dwDesiredAccess);
}
#endif
#endif
BOOST_FORCEINLINE HANDLE_ CreateMutexW(SECURITY_ATTRIBUTES_* lpMutexAttributes, BOOL_ bInitialOwner, LPCWSTR_ lpName)
{
#if BOOST_PLAT_WINDOWS_RUNTIME && BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
const DWORD_ flags = bInitialOwner ? create_mutex_initial_owner : 0u;
return ::CreateMutexExW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpMutexAttributes), lpName, flags, mutex_all_access);
#else
return ::CreateMutexW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpMutexAttributes), bInitialOwner, lpName);
#endif
}
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
BOOST_FORCEINLINE HANDLE_ CreateMutexExW(
SECURITY_ATTRIBUTES_* lpMutexAttributes,
LPCWSTR_ lpName,
DWORD_ dwFlags,
DWORD_ dwDesiredAccess)
{
return ::CreateMutexExW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpMutexAttributes), lpName, dwFlags, dwDesiredAccess);
}
#endif
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE HANDLE_ create_mutex(SECURITY_ATTRIBUTES_* lpAttributes, BOOL_ bInitialOwner, LPCSTR_ lpName)
{
return winapi::CreateMutexA(lpAttributes, bInitialOwner, lpName);
}
BOOST_FORCEINLINE HANDLE_ open_mutex(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCSTR_ lpName)
{
return ::OpenMutexA(dwDesiredAccess, bInheritHandle, lpName);
}
#endif
BOOST_FORCEINLINE HANDLE_ create_mutex(SECURITY_ATTRIBUTES_* lpAttributes, BOOL_ bInitialOwner, LPCWSTR_ lpName)
{
return winapi::CreateMutexW(lpAttributes, bInitialOwner, lpName);
}
BOOST_FORCEINLINE HANDLE_ open_mutex(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCWSTR_ lpName)
{
return ::OpenMutexW(dwDesiredAccess, bInheritHandle, lpName);
}
BOOST_FORCEINLINE HANDLE_ create_anonymous_mutex(SECURITY_ATTRIBUTES_* lpAttributes, BOOL_ bInitialOwner)
{
return winapi::CreateMutexW(lpAttributes, bInitialOwner, 0);
}
}
}
}
#endif // BOOST_DETAIL_WINAPI_MUTEX_HPP
@@ -0,0 +1,51 @@
// overlapped.hpp --------------------------------------------------------------//
// Copyright 2016 Klemens D. Morgenstern
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_OVERLAPPED_HPP_
#define BOOST_DETAIL_WINAPI_OVERLAPPED_HPP_
#include <boost/detail/winapi/basic_types.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
struct _OVERLAPPED;
}
#endif
namespace boost {
namespace detail {
namespace winapi {
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable:4201) // nonstandard extension used : nameless struct/union
#endif
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _OVERLAPPED {
ULONG_PTR_ Internal;
ULONG_PTR_ InternalHigh;
union {
struct {
DWORD_ Offset;
DWORD_ OffsetHigh;
};
PVOID_ Pointer;
};
HANDLE_ hEvent;
} OVERLAPPED_, *LPOVERLAPPED_;
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
}}}
#endif // BOOST_DETAIL_WINAPI_OVERLAPPED_HPP_
@@ -0,0 +1,56 @@
// page_protection_flags.hpp --------------------------------------------------------------//
// Copyright 2016 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_PAGE_PROTECTION_FLAGS_HPP
#define BOOST_DETAIL_WINAPI_PAGE_PROTECTION_FLAGS_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 )
const DWORD_ PAGE_NOACCESS_ = PAGE_NOACCESS;
const DWORD_ PAGE_READONLY_ = PAGE_READONLY;
const DWORD_ PAGE_READWRITE_ = PAGE_READWRITE;
const DWORD_ PAGE_WRITECOPY_ = PAGE_WRITECOPY;
const DWORD_ PAGE_EXECUTE_ = PAGE_EXECUTE;
const DWORD_ PAGE_EXECUTE_READ_ = PAGE_EXECUTE_READ;
const DWORD_ PAGE_EXECUTE_READWRITE_ = PAGE_EXECUTE_READWRITE;
const DWORD_ PAGE_EXECUTE_WRITECOPY_ = PAGE_EXECUTE_WRITECOPY;
const DWORD_ PAGE_GUARD_ = PAGE_GUARD;
const DWORD_ PAGE_NOCACHE_ = PAGE_NOCACHE;
const DWORD_ PAGE_WRITECOMBINE_ = PAGE_WRITECOMBINE;
#else // defined( BOOST_USE_WINDOWS_H )
const DWORD_ PAGE_NOACCESS_ = 0x01;
const DWORD_ PAGE_READONLY_ = 0x02;
const DWORD_ PAGE_READWRITE_ = 0x04;
const DWORD_ PAGE_WRITECOPY_ = 0x08;
const DWORD_ PAGE_EXECUTE_ = 0x10;
const DWORD_ PAGE_EXECUTE_READ_ = 0x20;
const DWORD_ PAGE_EXECUTE_READWRITE_ = 0x40;
const DWORD_ PAGE_EXECUTE_WRITECOPY_ = 0x80;
const DWORD_ PAGE_GUARD_ = 0x100;
const DWORD_ PAGE_NOCACHE_ = 0x200;
const DWORD_ PAGE_WRITECOMBINE_ = 0x400;
#endif // defined( BOOST_USE_WINDOWS_H )
}
}
}
#endif // BOOST_DETAIL_WINAPI_PAGE_PROTECTION_FLAGS_HPP
@@ -0,0 +1,317 @@
// pipes.hpp --------------------------------------------------------------//
// Copyright 2016 Klemens D. Morgenstern
// Copyright 2016 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_PIPES_HPP_
#define BOOST_DETAIL_WINAPI_PIPES_HPP_
#include <boost/detail/winapi/basic_types.hpp>
#include <boost/detail/winapi/config.hpp>
#include <boost/detail/winapi/overlapped.hpp>
#include <boost/predef/platform.h>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if BOOST_PLAT_WINDOWS_DESKTOP
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI ImpersonateNamedPipeClient(
boost::detail::winapi::HANDLE_ hNamedPipe);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI CreatePipe(
boost::detail::winapi::PHANDLE_ hReadPipe,
boost::detail::winapi::PHANDLE_ hWritePipe,
_SECURITY_ATTRIBUTES* lpPipeAttributes,
boost::detail::winapi::DWORD_ nSize);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI ConnectNamedPipe(
boost::detail::winapi::HANDLE_ hNamedPipe,
_OVERLAPPED* lpOverlapped);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI DisconnectNamedPipe(
boost::detail::winapi::HANDLE_ hNamedPipe);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI SetNamedPipeHandleState(
boost::detail::winapi::HANDLE_ hNamedPipe,
boost::detail::winapi::LPDWORD_ lpMode,
boost::detail::winapi::LPDWORD_ lpMaxCollectionCount,
boost::detail::winapi::LPDWORD_ lpCollectDataTimeout);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI PeekNamedPipe(
boost::detail::winapi::HANDLE_ hNamedPipe,
boost::detail::winapi::LPVOID_ lpBuffer,
boost::detail::winapi::DWORD_ nBufferSize,
boost::detail::winapi::LPDWORD_ lpBytesRead,
boost::detail::winapi::LPDWORD_ lpTotalBytesAvail,
boost::detail::winapi::LPDWORD_ lpBytesLeftThisMessage);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI TransactNamedPipe(
boost::detail::winapi::HANDLE_ hNamedPipe,
boost::detail::winapi::LPVOID_ lpInBuffer,
boost::detail::winapi::DWORD_ nInBufferSize,
boost::detail::winapi::LPVOID_ lpOutBuffer,
boost::detail::winapi::DWORD_ nOutBufferSize,
boost::detail::winapi::LPDWORD_ lpBytesRead,
_OVERLAPPED* lpOverlapped);
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI CreateNamedPipeA(
boost::detail::winapi::LPCSTR_ lpName,
boost::detail::winapi::DWORD_ dwOpenMode,
boost::detail::winapi::DWORD_ dwPipeMode,
boost::detail::winapi::DWORD_ nMaxInstances,
boost::detail::winapi::DWORD_ nOutBufferSize,
boost::detail::winapi::DWORD_ nInBufferSize,
boost::detail::winapi::DWORD_ nDefaultTimeOut,
_SECURITY_ATTRIBUTES *lpSecurityAttributes);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI WaitNamedPipeA(
boost::detail::winapi::LPCSTR_ lpNamedPipeName,
boost::detail::winapi::DWORD_ nTimeOut);
#endif // !defined( BOOST_NO_ANSI_APIS )
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI CreateNamedPipeW(
boost::detail::winapi::LPCWSTR_ lpName,
boost::detail::winapi::DWORD_ dwOpenMode,
boost::detail::winapi::DWORD_ dwPipeMode,
boost::detail::winapi::DWORD_ nMaxInstances,
boost::detail::winapi::DWORD_ nOutBufferSize,
boost::detail::winapi::DWORD_ nInBufferSize,
boost::detail::winapi::DWORD_ nDefaultTimeOut,
_SECURITY_ATTRIBUTES* lpSecurityAttributes);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI WaitNamedPipeW(
boost::detail::winapi::LPCWSTR_ lpNamedPipeName,
boost::detail::winapi::DWORD_ nTimeOut);
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI GetNamedPipeClientComputerNameA(
boost::detail::winapi::HANDLE_ Pipe,
boost::detail::winapi::LPSTR_ ClientComputerName,
boost::detail::winapi::ULONG_ ClientComputerNameLength);
#endif // !defined( BOOST_NO_ANSI_APIS )
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI GetNamedPipeClientComputerNameW(
boost::detail::winapi::HANDLE_ Pipe,
boost::detail::winapi::LPWSTR_ ClientComputerName,
boost::detail::winapi::ULONG_ ClientComputerNameLength);
#endif
} // extern "C"
#endif // !defined( BOOST_USE_WINDOWS_H )
namespace boost {
namespace detail {
namespace winapi {
#if defined( BOOST_USE_WINDOWS_H )
const DWORD_ PIPE_ACCESS_DUPLEX_ = PIPE_ACCESS_DUPLEX;
const DWORD_ PIPE_ACCESS_INBOUND_ = PIPE_ACCESS_INBOUND;
const DWORD_ PIPE_ACCESS_OUTBOUND_ = PIPE_ACCESS_OUTBOUND;
const DWORD_ PIPE_TYPE_BYTE_ = PIPE_TYPE_BYTE;
const DWORD_ PIPE_TYPE_MESSAGE_ = PIPE_TYPE_MESSAGE;
const DWORD_ PIPE_READMODE_BYTE_ = PIPE_READMODE_BYTE;
const DWORD_ PIPE_READMODE_MESSAGE_ = PIPE_READMODE_MESSAGE;
const DWORD_ PIPE_WAIT_ = PIPE_WAIT;
const DWORD_ PIPE_NOWAIT_ = PIPE_NOWAIT;
const DWORD_ PIPE_UNLIMITED_INSTANCES_ = PIPE_UNLIMITED_INSTANCES;
const DWORD_ NMPWAIT_USE_DEFAULT_WAIT_ = NMPWAIT_USE_DEFAULT_WAIT;
const DWORD_ NMPWAIT_NOWAIT_ = NMPWAIT_NOWAIT;
const DWORD_ NMPWAIT_WAIT_FOREVER_ = NMPWAIT_WAIT_FOREVER;
#else // defined( BOOST_USE_WINDOWS_H )
const DWORD_ PIPE_ACCESS_DUPLEX_ = 0x00000003;
const DWORD_ PIPE_ACCESS_INBOUND_ = 0x00000001;
const DWORD_ PIPE_ACCESS_OUTBOUND_ = 0x00000002;
const DWORD_ PIPE_TYPE_BYTE_ = 0x00000000;
const DWORD_ PIPE_TYPE_MESSAGE_ = 0x00000004;
const DWORD_ PIPE_READMODE_BYTE_ = 0x00000000;
const DWORD_ PIPE_READMODE_MESSAGE_ = 0x00000002;
const DWORD_ PIPE_WAIT_ = 0x00000000;
const DWORD_ PIPE_NOWAIT_ = 0x00000001;
const DWORD_ PIPE_UNLIMITED_INSTANCES_ = 255u;
const DWORD_ NMPWAIT_USE_DEFAULT_WAIT_ = 0x00000000;
const DWORD_ NMPWAIT_NOWAIT_ = 0x00000001;
const DWORD_ NMPWAIT_WAIT_FOREVER_ = 0xFFFFFFFF;
#endif // defined( BOOST_USE_WINDOWS_H )
// These constants are not defined in Windows SDK prior to 7.0A
const DWORD_ PIPE_ACCEPT_REMOTE_CLIENTS_ = 0x00000000;
const DWORD_ PIPE_REJECT_REMOTE_CLIENTS_ = 0x00000008;
using ::ImpersonateNamedPipeClient;
using ::DisconnectNamedPipe;
using ::SetNamedPipeHandleState;
using ::PeekNamedPipe;
#if !defined( BOOST_NO_ANSI_APIS )
using ::WaitNamedPipeA;
#endif
using ::WaitNamedPipeW;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
#if !defined( BOOST_NO_ANSI_APIS )
using ::GetNamedPipeClientComputerNameA;
#endif // !defined( BOOST_NO_ANSI_APIS )
using ::GetNamedPipeClientComputerNameW;
#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
BOOST_FORCEINLINE BOOL_ CreatePipe(PHANDLE_ hReadPipe, PHANDLE_ hWritePipe, LPSECURITY_ATTRIBUTES_ lpPipeAttributes, DWORD_ nSize)
{
return ::CreatePipe(hReadPipe, hWritePipe, reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpPipeAttributes), nSize);
}
BOOST_FORCEINLINE BOOL_ ConnectNamedPipe(HANDLE_ hNamedPipe, LPOVERLAPPED_ lpOverlapped)
{
return ::ConnectNamedPipe(hNamedPipe, reinterpret_cast< ::_OVERLAPPED* >(lpOverlapped));
}
BOOST_FORCEINLINE BOOL_ TransactNamedPipe(HANDLE_ hNamedPipe, LPVOID_ lpInBuffer, DWORD_ nInBufferSize, LPVOID_ lpOutBuffer, DWORD_ nOutBufferSize, LPDWORD_ lpBytesRead, LPOVERLAPPED_ lpOverlapped)
{
return ::TransactNamedPipe(hNamedPipe, lpInBuffer, nInBufferSize, lpOutBuffer, nOutBufferSize, lpBytesRead, reinterpret_cast< ::_OVERLAPPED* >(lpOverlapped));
}
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE HANDLE_ CreateNamedPipeA(
LPCSTR_ lpName,
DWORD_ dwOpenMode,
DWORD_ dwPipeMode,
DWORD_ nMaxInstances,
DWORD_ nOutBufferSize,
DWORD_ nInBufferSize,
DWORD_ nDefaultTimeOut,
LPSECURITY_ATTRIBUTES_ lpSecurityAttributes)
{
return ::CreateNamedPipeA(
lpName,
dwOpenMode,
dwPipeMode,
nMaxInstances,
nOutBufferSize,
nInBufferSize,
nDefaultTimeOut,
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSecurityAttributes));
}
BOOST_FORCEINLINE HANDLE_ create_named_pipe(
LPCSTR_ lpName,
DWORD_ dwOpenMode,
DWORD_ dwPipeMode,
DWORD_ nMaxInstances,
DWORD_ nOutBufferSize,
DWORD_ nInBufferSize,
DWORD_ nDefaultTimeOut,
LPSECURITY_ATTRIBUTES_ lpSecurityAttributes)
{
return ::CreateNamedPipeA(
lpName,
dwOpenMode,
dwPipeMode,
nMaxInstances,
nOutBufferSize,
nInBufferSize,
nDefaultTimeOut,
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSecurityAttributes));
}
#endif // !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE HANDLE_ CreateNamedPipeW(
LPCWSTR_ lpName,
DWORD_ dwOpenMode,
DWORD_ dwPipeMode,
DWORD_ nMaxInstances,
DWORD_ nOutBufferSize,
DWORD_ nInBufferSize,
DWORD_ nDefaultTimeOut,
LPSECURITY_ATTRIBUTES_ lpSecurityAttributes)
{
return ::CreateNamedPipeW(
lpName,
dwOpenMode,
dwPipeMode,
nMaxInstances,
nOutBufferSize,
nInBufferSize,
nDefaultTimeOut,
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSecurityAttributes));
}
BOOST_FORCEINLINE HANDLE_ create_named_pipe(
LPCWSTR_ lpName,
DWORD_ dwOpenMode,
DWORD_ dwPipeMode,
DWORD_ nMaxInstances,
DWORD_ nOutBufferSize,
DWORD_ nInBufferSize,
DWORD_ nDefaultTimeOut,
LPSECURITY_ATTRIBUTES_ lpSecurityAttributes)
{
return ::CreateNamedPipeW(
lpName,
dwOpenMode,
dwPipeMode,
nMaxInstances,
nOutBufferSize,
nInBufferSize,
nDefaultTimeOut,
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSecurityAttributes));
}
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE BOOL_ wait_named_pipe(LPCSTR_ lpNamedPipeName, DWORD_ nTimeOut)
{
return ::WaitNamedPipeA(lpNamedPipeName, nTimeOut);
}
#endif //BOOST_NO_ANSI_APIS
BOOST_FORCEINLINE BOOL_ wait_named_pipe(LPCWSTR_ lpNamedPipeName, DWORD_ nTimeOut)
{
return ::WaitNamedPipeW(lpNamedPipeName, nTimeOut);
}
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE BOOL_ get_named_pipe_client_computer_name(HANDLE_ Pipe, LPSTR_ ClientComputerName, ULONG_ ClientComputerNameLength)
{
return ::GetNamedPipeClientComputerNameA(Pipe, ClientComputerName, ClientComputerNameLength);
}
#endif // !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE BOOL_ get_named_pipe_client_computer_name(HANDLE_ Pipe, LPWSTR_ ClientComputerName, ULONG_ ClientComputerNameLength)
{
return ::GetNamedPipeClientComputerNameW(Pipe, ClientComputerName, ClientComputerNameLength);
}
#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
}
}
}
#endif // BOOST_PLAT_WINDOWS_DESKTOP
#endif // BOOST_DETAIL_WINAPI_PIPES_HPP_
@@ -0,0 +1,78 @@
// priority_class.hpp --------------------------------------------------------------//
// Copyright 2016 Klemens D. Morgenstern
// Copyright 2016 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_PRIORITY_CLASS_HPP_
#define BOOST_DETAIL_WINAPI_PRIORITY_CLASS_HPP_
#include <boost/detail/winapi/basic_types.hpp>
#include <boost/predef/platform.h>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if BOOST_PLAT_WINDOWS_DESKTOP
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
GetPriorityClass(boost::detail::winapi::HANDLE_ hProcess);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
SetPriorityClass(
boost::detail::winapi::HANDLE_ hProcess,
boost::detail::winapi::DWORD_ dwPriorityClass);
} // extern "C"
#endif //defined BOOST_WINDOWS_H
namespace boost {
namespace detail {
namespace winapi {
#if defined(BOOST_USE_WINDOWS_H)
const DWORD_ NORMAL_PRIORITY_CLASS_ = NORMAL_PRIORITY_CLASS;
const DWORD_ IDLE_PRIORITY_CLASS_ = IDLE_PRIORITY_CLASS;
const DWORD_ HIGH_PRIORITY_CLASS_ = HIGH_PRIORITY_CLASS;
const DWORD_ REALTIME_PRIORITY_CLASS_ = REALTIME_PRIORITY_CLASS;
const DWORD_ BELOW_NORMAL_PRIORITY_CLASS_ = BELOW_NORMAL_PRIORITY_CLASS;
const DWORD_ ABOVE_NORMAL_PRIORITY_CLASS_ = ABOVE_NORMAL_PRIORITY_CLASS;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
const DWORD_ PROCESS_MODE_BACKGROUND_BEGIN_ = PROCESS_MODE_BACKGROUND_BEGIN;
const DWORD_ PROCESS_MODE_BACKGROUND_END_ = PROCESS_MODE_BACKGROUND_END;
#endif
#else // defined( BOOST_USE_WINDOWS_H )
const DWORD_ NORMAL_PRIORITY_CLASS_ = 0x20;
const DWORD_ IDLE_PRIORITY_CLASS_ = 0x40;
const DWORD_ HIGH_PRIORITY_CLASS_ = 0x80;
const DWORD_ REALTIME_PRIORITY_CLASS_ = 0x100;
const DWORD_ BELOW_NORMAL_PRIORITY_CLASS_ = 0x4000;
const DWORD_ ABOVE_NORMAL_PRIORITY_CLASS_ = 0x8000;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
const DWORD_ PROCESS_MODE_BACKGROUND_BEGIN_ = 0x100000;
const DWORD_ PROCESS_MODE_BACKGROUND_END_ = 0x200000;
#endif
#endif // defined( BOOST_USE_WINDOWS_H )
using ::GetPriorityClass;
using ::SetPriorityClass;
}
}
}
#endif // BOOST_PLAT_WINDOWS_DESKTOP
#endif // BOOST_DETAIL_WINAPI_PRIORITY_CLASS_HPP_
@@ -0,0 +1,421 @@
// process.hpp --------------------------------------------------------------//
// Copyright 2016 Klemens D. Morgenstern
// Copyright 2016 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_PROCESS_HPP_
#define BOOST_DETAIL_WINAPI_PROCESS_HPP_
#include <boost/detail/winapi/config.hpp>
#include <boost/detail/winapi/basic_types.hpp>
#include <boost/detail/winapi/access_rights.hpp>
#include <boost/detail/winapi/get_current_process.hpp>
#include <boost/detail/winapi/get_current_process_id.hpp>
#include <boost/predef/platform.h>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if BOOST_PLAT_WINDOWS_DESKTOP
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
struct _PROCESS_INFORMATION;
#if !defined( BOOST_NO_ANSI_APIS )
struct _STARTUPINFOA;
#endif
struct _STARTUPINFOW;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
struct _PROC_THREAD_ATTRIBUTE_LIST;
#if !defined( BOOST_NO_ANSI_APIS )
struct _STARTUPINFOEXA;
#endif
struct _STARTUPINFOEXW;
#endif
BOOST_SYMBOL_IMPORT BOOST_NORETURN boost::detail::winapi::VOID_ WINAPI
ExitProcess(boost::detail::winapi::UINT_ uExitCode);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI TerminateProcess(
boost::detail::winapi::HANDLE_ hProcess,
boost::detail::winapi::UINT_ uExitCode);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI GetExitCodeProcess(
boost::detail::winapi::HANDLE_ hProcess,
boost::detail::winapi::LPDWORD_ lpExitCode);
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI CreateProcessA(
boost::detail::winapi::LPCSTR_ lpApplicationName,
boost::detail::winapi::LPSTR_ lpCommandLine,
::_SECURITY_ATTRIBUTES* lpProcessAttributes,
::_SECURITY_ATTRIBUTES* lpThreadAttributes,
boost::detail::winapi::INT_ bInheritHandles,
boost::detail::winapi::DWORD_ dwCreationFlags,
boost::detail::winapi::LPVOID_ lpEnvironment,
boost::detail::winapi::LPCSTR_ lpCurrentDirectory,
::_STARTUPINFOA* lpStartupInfo,
::_PROCESS_INFORMATION* lpProcessInformation);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI CreateProcessW(
boost::detail::winapi::LPCWSTR_ lpApplicationName,
boost::detail::winapi::LPWSTR_ lpCommandLine,
::_SECURITY_ATTRIBUTES* lpProcessAttributes,
::_SECURITY_ATTRIBUTES* lpThreadAttributes,
boost::detail::winapi::INT_ bInheritHandles,
boost::detail::winapi::DWORD_ dwCreationFlags,
boost::detail::winapi::LPVOID_ lpEnvironment,
boost::detail::winapi::LPCWSTR_ lpCurrentDirectory,
::_STARTUPINFOW* lpStartupInfo,
::_PROCESS_INFORMATION* lpProcessInformation);
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI OpenProcess(
boost::detail::winapi::DWORD_ dwDesiredAccess,
boost::detail::winapi::BOOL_ bInheritHandle,
boost::detail::winapi::DWORD_ dwProcessId);
} // extern "C"
#endif //defined BOOST_WINDOWS_H
namespace boost {
namespace detail {
namespace winapi {
#if defined( BOOST_USE_WINDOWS_H )
const DWORD_ DEBUG_PROCESS_ = DEBUG_PROCESS;
const DWORD_ DEBUG_ONLY_THIS_PROCESS_ = DEBUG_ONLY_THIS_PROCESS;
const DWORD_ CREATE_SUSPENDED_ = CREATE_SUSPENDED;
const DWORD_ DETACHED_PROCESS_ = DETACHED_PROCESS;
const DWORD_ CREATE_NEW_CONSOLE_ = CREATE_NEW_CONSOLE;
const DWORD_ CREATE_NEW_PROCESS_GROUP_ = CREATE_NEW_PROCESS_GROUP;
const DWORD_ CREATE_UNICODE_ENVIRONMENT_ = CREATE_UNICODE_ENVIRONMENT;
const DWORD_ CREATE_SEPARATE_WOW_VDM_ = CREATE_SEPARATE_WOW_VDM;
const DWORD_ CREATE_SHARED_WOW_VDM_ = CREATE_SHARED_WOW_VDM;
const DWORD_ CREATE_FORCEDOS_ = CREATE_FORCEDOS;
const DWORD_ CREATE_BREAKAWAY_FROM_JOB_ = CREATE_BREAKAWAY_FROM_JOB;
const DWORD_ CREATE_DEFAULT_ERROR_MODE_ = CREATE_DEFAULT_ERROR_MODE;
const DWORD_ CREATE_NO_WINDOW_ = CREATE_NO_WINDOW;
// Undocumented
const DWORD_ PROFILE_USER_ = PROFILE_USER;
const DWORD_ PROFILE_KERNEL_ = PROFILE_KERNEL;
const DWORD_ PROFILE_SERVER_ = PROFILE_SERVER;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
const DWORD_ CREATE_PROTECTED_PROCESS_ = CREATE_PROTECTED_PROCESS;
const DWORD_ EXTENDED_STARTUPINFO_PRESENT_ = EXTENDED_STARTUPINFO_PRESENT;
#endif
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN7
const DWORD_ INHERIT_PARENT_AFFINITY_ = INHERIT_PARENT_AFFINITY;
#endif
// Only documented for Windows CE
#if defined(UNDER_CE)
const DWORD_ INHERIT_CALLER_PRIORITY_ = INHERIT_CALLER_PRIORITY;
#endif
const DWORD_ STARTF_USESHOWWINDOW_ = STARTF_USESHOWWINDOW;
const DWORD_ STARTF_USESIZE_ = STARTF_USESIZE;
const DWORD_ STARTF_USEPOSITION_ = STARTF_USEPOSITION;
const DWORD_ STARTF_USECOUNTCHARS_ = STARTF_USECOUNTCHARS;
const DWORD_ STARTF_USEFILLATTRIBUTE_ = STARTF_USEFILLATTRIBUTE;
const DWORD_ STARTF_RUNFULLSCREEN_ = STARTF_RUNFULLSCREEN;
const DWORD_ STARTF_FORCEONFEEDBACK_ = STARTF_FORCEONFEEDBACK;
const DWORD_ STARTF_FORCEOFFFEEDBACK_ = STARTF_FORCEOFFFEEDBACK;
const DWORD_ STARTF_USESTDHANDLES_ = STARTF_USESTDHANDLES;
const DWORD_ STARTF_USEHOTKEY_ = STARTF_USEHOTKEY;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN7
const DWORD_ STARTF_TITLEISLINKNAME_ = STARTF_TITLEISLINKNAME;
const DWORD_ STARTF_TITLEISAPPID_ = STARTF_TITLEISAPPID;
const DWORD_ STARTF_PREVENTPINNING_ = STARTF_PREVENTPINNING;
#endif
const DWORD_ PROCESS_TERMINATE_ = PROCESS_TERMINATE;
const DWORD_ PROCESS_CREATE_THREAD_ = PROCESS_CREATE_THREAD;
const DWORD_ PROCESS_SET_SESSIONID_ = PROCESS_SET_SESSIONID;
const DWORD_ PROCESS_VM_OPERATION_ = PROCESS_VM_OPERATION;
const DWORD_ PROCESS_VM_READ_ = PROCESS_VM_READ;
const DWORD_ PROCESS_VM_WRITE_ = PROCESS_VM_WRITE;
const DWORD_ PROCESS_DUP_HANDLE_ = PROCESS_DUP_HANDLE;
const DWORD_ PROCESS_CREATE_PROCESS_ = PROCESS_CREATE_PROCESS;
const DWORD_ PROCESS_SET_QUOTA_ = PROCESS_SET_QUOTA;
const DWORD_ PROCESS_SET_INFORMATION_ = PROCESS_SET_INFORMATION;
const DWORD_ PROCESS_QUERY_INFORMATION_ = PROCESS_QUERY_INFORMATION;
const DWORD_ PROCESS_SUSPEND_RESUME_ = PROCESS_SUSPEND_RESUME;
const DWORD_ PROCESS_ALL_ACCESS_ = PROCESS_ALL_ACCESS;
#else // defined( BOOST_USE_WINDOWS_H )
const DWORD_ DEBUG_PROCESS_ = 0x1;
const DWORD_ DEBUG_ONLY_THIS_PROCESS_ = 0x2;
const DWORD_ CREATE_SUSPENDED_ = 0x4;
const DWORD_ DETACHED_PROCESS_ = 0x8;
const DWORD_ CREATE_NEW_CONSOLE_ = 0x10;
const DWORD_ CREATE_NEW_PROCESS_GROUP_ = 0x200;
const DWORD_ CREATE_UNICODE_ENVIRONMENT_ = 0x400;
const DWORD_ CREATE_SEPARATE_WOW_VDM_ = 0x800;
const DWORD_ CREATE_SHARED_WOW_VDM_ = 0x1000;
const DWORD_ CREATE_FORCEDOS_ = 0x2000;
const DWORD_ CREATE_BREAKAWAY_FROM_JOB_ = 0x1000000;
const DWORD_ CREATE_DEFAULT_ERROR_MODE_ = 0x4000000;
const DWORD_ CREATE_NO_WINDOW_ = 0x8000000;
// Undocumented
const DWORD_ PROFILE_USER_ = 0x10000000;
const DWORD_ PROFILE_KERNEL_ = 0x20000000;
const DWORD_ PROFILE_SERVER_ = 0x40000000;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
const DWORD_ CREATE_PROTECTED_PROCESS_ = 0x40000;
const DWORD_ EXTENDED_STARTUPINFO_PRESENT_ = 0x80000;
#endif
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN7
const DWORD_ INHERIT_PARENT_AFFINITY_ = 0x10000;
#endif
// Only documented for Windows CE
#if defined(UNDER_CE)
const DWORD_ INHERIT_CALLER_PRIORITY_ = 0x20000;
#endif
const DWORD_ STARTF_USESHOWWINDOW_ = 0x00000001;
const DWORD_ STARTF_USESIZE_ = 0x00000002;
const DWORD_ STARTF_USEPOSITION_ = 0x00000004;
const DWORD_ STARTF_USECOUNTCHARS_ = 0x00000008;
const DWORD_ STARTF_USEFILLATTRIBUTE_ = 0x00000010;
const DWORD_ STARTF_RUNFULLSCREEN_ = 0x00000020;
const DWORD_ STARTF_FORCEONFEEDBACK_ = 0x00000040;
const DWORD_ STARTF_FORCEOFFFEEDBACK_ = 0x00000080;
const DWORD_ STARTF_USESTDHANDLES_ = 0x00000100;
const DWORD_ STARTF_USEHOTKEY_ = 0x00000200;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN7
const DWORD_ STARTF_TITLEISLINKNAME_ = 0x00000800;
const DWORD_ STARTF_TITLEISAPPID_ = 0x00001000;
const DWORD_ STARTF_PREVENTPINNING_ = 0x00002000;
#endif
const DWORD_ PROCESS_TERMINATE_ = 0x0001;
const DWORD_ PROCESS_CREATE_THREAD_ = 0x0002;
const DWORD_ PROCESS_SET_SESSIONID_ = 0x0004;
const DWORD_ PROCESS_VM_OPERATION_ = 0x0008;
const DWORD_ PROCESS_VM_READ_ = 0x0010;
const DWORD_ PROCESS_VM_WRITE_ = 0x0020;
const DWORD_ PROCESS_DUP_HANDLE_ = 0x0040;
const DWORD_ PROCESS_CREATE_PROCESS_ = 0x0080;
const DWORD_ PROCESS_SET_QUOTA_ = 0x0100;
const DWORD_ PROCESS_SET_INFORMATION_ = 0x0200;
const DWORD_ PROCESS_QUERY_INFORMATION_ = 0x0400;
const DWORD_ PROCESS_SUSPEND_RESUME_ = 0x0800;
const DWORD_ PROCESS_ALL_ACCESS_ = (STANDARD_RIGHTS_REQUIRED_ | SYNCHRONIZE_ | 0xFFF);
#endif // defined( BOOST_USE_WINDOWS_H )
#if defined( BOOST_USE_WINDOWS_H ) && !defined( BOOST_WINAPI_IS_MINGW )
const DWORD_ CREATE_PRESERVE_CODE_AUTHZ_LEVEL_ = CREATE_PRESERVE_CODE_AUTHZ_LEVEL;
// Undocumented
const DWORD_ CREATE_IGNORE_SYSTEM_DEFAULT_ = CREATE_IGNORE_SYSTEM_DEFAULT;
#else // defined( BOOST_USE_WINDOWS_H ) && !defined( BOOST_WINAPI_IS_MINGW )
const DWORD_ CREATE_PRESERVE_CODE_AUTHZ_LEVEL_ = 0x2000000;
// Undocumented
const DWORD_ CREATE_IGNORE_SYSTEM_DEFAULT_ = 0x80000000;
#endif // defined( BOOST_USE_WINDOWS_H ) && !defined( BOOST_WINAPI_IS_MINGW )
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _PROCESS_INFORMATION {
HANDLE_ hProcess;
HANDLE_ hThread;
DWORD_ dwProcessId;
DWORD_ dwThreadId;
} PROCESS_INFORMATION_, *PPROCESS_INFORMATION_, *LPPROCESS_INFORMATION_;
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _STARTUPINFOA {
DWORD_ cb;
LPSTR_ lpReserved;
LPSTR_ lpDesktop;
LPSTR_ lpTitle;
DWORD_ dwX;
DWORD_ dwY;
DWORD_ dwXSize;
DWORD_ dwYSize;
DWORD_ dwXCountChars;
DWORD_ dwYCountChars;
DWORD_ dwFillAttribute;
DWORD_ dwFlags;
WORD_ wShowWindow;
WORD_ cbReserved2;
LPBYTE_ lpReserved2;
HANDLE_ hStdInput;
HANDLE_ hStdOutput;
HANDLE_ hStdError;
} STARTUPINFOA_, *LPSTARTUPINFOA_;
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _STARTUPINFOW {
DWORD_ cb;
LPWSTR_ lpReserved;
LPWSTR_ lpDesktop;
LPWSTR_ lpTitle;
DWORD_ dwX;
DWORD_ dwY;
DWORD_ dwXSize;
DWORD_ dwYSize;
DWORD_ dwXCountChars;
DWORD_ dwYCountChars;
DWORD_ dwFillAttribute;
DWORD_ dwFlags;
WORD_ wShowWindow;
WORD_ cbReserved2;
LPBYTE_ lpReserved2;
HANDLE_ hStdInput;
HANDLE_ hStdOutput;
HANDLE_ hStdError;
} STARTUPINFOW_, *LPSTARTUPINFOW_;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
typedef struct _PROC_THREAD_ATTRIBUTE_LIST PROC_THREAD_ATTRIBUTE_LIST_, *PPROC_THREAD_ATTRIBUTE_LIST_;
#if !defined(BOOST_NO_ANSI_APIS)
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _STARTUPINFOEXA {
STARTUPINFOA_ StartupInfo;
PPROC_THREAD_ATTRIBUTE_LIST_ lpAttributeList;
} STARTUPINFOEXA_, *LPSTARTUPINFOEXA_;
#endif //BOOST_NO_ANSI_APIS
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _STARTUPINFOEXW {
STARTUPINFOW_ StartupInfo;
PPROC_THREAD_ATTRIBUTE_LIST_ lpAttributeList;
} STARTUPINFOEXW_, *LPSTARTUPINFOEXW_;
#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
using ::GetExitCodeProcess;
using ::ExitProcess;
using ::TerminateProcess;
using ::OpenProcess;
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE BOOL_ CreateProcessA(
LPCSTR_ lpApplicationName,
LPSTR_ lpCommandLine,
LPSECURITY_ATTRIBUTES_ lpProcessAttributes,
LPSECURITY_ATTRIBUTES_ lpThreadAttributes,
INT_ bInheritHandles,
DWORD_ dwCreationFlags,
LPVOID_ lpEnvironment,
LPCSTR_ lpCurrentDirectory,
LPSTARTUPINFOA_ lpStartupInfo,
LPPROCESS_INFORMATION_ lpProcessInformation)
{
return ::CreateProcessA(
lpApplicationName,
lpCommandLine,
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpProcessAttributes),
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpThreadAttributes),
bInheritHandles,
dwCreationFlags,
lpEnvironment,
lpCurrentDirectory,
reinterpret_cast< ::_STARTUPINFOA* >(lpStartupInfo),
reinterpret_cast< ::_PROCESS_INFORMATION* >(lpProcessInformation));
}
BOOST_FORCEINLINE BOOL_ create_process(
LPCSTR_ lpApplicationName,
LPSTR_ lpCommandLine,
LPSECURITY_ATTRIBUTES_ lpProcessAttributes,
LPSECURITY_ATTRIBUTES_ lpThreadAttributes,
INT_ bInheritHandles,
DWORD_ dwCreationFlags,
LPVOID_ lpEnvironment,
LPCSTR_ lpCurrentDirectory,
LPSTARTUPINFOA_ lpStartupInfo,
LPPROCESS_INFORMATION_ lpProcessInformation)
{
return ::CreateProcessA(
lpApplicationName,
lpCommandLine,
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpProcessAttributes),
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpThreadAttributes),
bInheritHandles,
dwCreationFlags,
lpEnvironment,
lpCurrentDirectory,
reinterpret_cast< ::_STARTUPINFOA* >(lpStartupInfo),
reinterpret_cast< ::_PROCESS_INFORMATION* >(lpProcessInformation));
}
#endif
BOOST_FORCEINLINE BOOL_ CreateProcessW(
LPCWSTR_ lpApplicationName,
LPWSTR_ lpCommandLine,
LPSECURITY_ATTRIBUTES_ lpProcessAttributes,
LPSECURITY_ATTRIBUTES_ lpThreadAttributes,
INT_ bInheritHandles,
DWORD_ dwCreationFlags,
LPVOID_ lpEnvironment,
LPCWSTR_ lpCurrentDirectory,
LPSTARTUPINFOW_ lpStartupInfo,
LPPROCESS_INFORMATION_ lpProcessInformation)
{
return ::CreateProcessW(
lpApplicationName,
lpCommandLine,
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpProcessAttributes),
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpThreadAttributes),
bInheritHandles,
dwCreationFlags,
lpEnvironment,
lpCurrentDirectory,
reinterpret_cast< ::_STARTUPINFOW* >(lpStartupInfo),
reinterpret_cast< ::_PROCESS_INFORMATION* >(lpProcessInformation));
}
BOOST_FORCEINLINE BOOL_ create_process(
LPCWSTR_ lpApplicationName,
LPWSTR_ lpCommandLine,
LPSECURITY_ATTRIBUTES_ lpProcessAttributes,
LPSECURITY_ATTRIBUTES_ lpThreadAttributes,
INT_ bInheritHandles,
DWORD_ dwCreationFlags,
LPVOID_ lpEnvironment,
LPCWSTR_ lpCurrentDirectory,
LPSTARTUPINFOW_ lpStartupInfo,
LPPROCESS_INFORMATION_ lpProcessInformation)
{
return ::CreateProcessW(
lpApplicationName,
lpCommandLine,
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpProcessAttributes),
reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpThreadAttributes),
bInheritHandles,
dwCreationFlags,
lpEnvironment,
lpCurrentDirectory,
reinterpret_cast< ::_STARTUPINFOW* >(lpStartupInfo),
reinterpret_cast< ::_PROCESS_INFORMATION* >(lpProcessInformation));
}
}
}
}
#endif // BOOST_PLAT_WINDOWS_DESKTOP
#endif // BOOST_DETAIL_WINAPI_PROCESS_HPP_
@@ -0,0 +1,80 @@
// security.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_SECURITY_HPP
#define BOOST_DETAIL_WINAPI_SECURITY_HPP
#include <boost/detail/winapi/basic_types.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
struct _ACL;
struct _SECURITY_DESCRIPTOR;
#if defined( BOOST_WINAPI_IS_MINGW )
typedef _SECURITY_DESCRIPTOR *PSECURITY_DESCRIPTOR;
#else
typedef boost::detail::winapi::PVOID_ PSECURITY_DESCRIPTOR;
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
InitializeSecurityDescriptor(
PSECURITY_DESCRIPTOR pSecurityDescriptor,
boost::detail::winapi::DWORD_ dwRevision);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
SetSecurityDescriptorDacl(
PSECURITY_DESCRIPTOR pSecurityDescriptor,
boost::detail::winapi::BOOL_ bDaclPresent,
::_ACL* pDacl,
boost::detail::winapi::BOOL_ bDaclDefaulted);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
typedef PVOID_ PSID_;
typedef WORD_ SECURITY_DESCRIPTOR_CONTROL_, *PSECURITY_DESCRIPTOR_CONTROL_;
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _ACL {
BYTE_ AclRevision;
BYTE_ Sbz1;
WORD_ AclSize;
WORD_ AceCount;
WORD_ Sbz2;
} ACL_, *PACL_;
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _SECURITY_DESCRIPTOR {
BYTE_ Revision;
BYTE_ Sbz1;
SECURITY_DESCRIPTOR_CONTROL_ Control;
PSID_ Owner;
PSID_ Group;
PACL_ Sacl;
PACL_ Dacl;
} SECURITY_DESCRIPTOR_, *PISECURITY_DESCRIPTOR_;
typedef ::PSECURITY_DESCRIPTOR PSECURITY_DESCRIPTOR_;
using ::InitializeSecurityDescriptor;
BOOST_FORCEINLINE BOOL_ SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR_ pSecurityDescriptor, BOOL_ bDaclPresent, PACL_ pDacl, BOOL_ bDaclDefaulted)
{
return ::SetSecurityDescriptorDacl(pSecurityDescriptor, bDaclPresent, reinterpret_cast< ::_ACL* >(pDacl), bDaclDefaulted);
}
}
}
}
#endif // BOOST_DETAIL_WINAPI_SECURITY_HPP
@@ -0,0 +1,177 @@
// semaphore.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_SEMAPHORE_HPP
#define BOOST_DETAIL_WINAPI_SEMAPHORE_HPP
#include <boost/detail/winapi/basic_types.hpp>
#include <boost/predef/platform.h>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
#if !defined( BOOST_NO_ANSI_APIS )
#if !defined( BOOST_PLAT_WINDOWS_RUNTIME_AVALIABLE )
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
CreateSemaphoreA(
::_SECURITY_ATTRIBUTES* lpSemaphoreAttributes,
boost::detail::winapi::LONG_ lInitialCount,
boost::detail::winapi::LONG_ lMaximumCount,
boost::detail::winapi::LPCSTR_ lpName);
#endif
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
CreateSemaphoreExA(
::_SECURITY_ATTRIBUTES* lpSemaphoreAttributes,
boost::detail::winapi::LONG_ lInitialCount,
boost::detail::winapi::LONG_ lMaximumCount,
boost::detail::winapi::LPCSTR_ lpName,
boost::detail::winapi::DWORD_ dwFlags,
boost::detail::winapi::DWORD_ dwDesiredAccess);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
OpenSemaphoreA(
boost::detail::winapi::DWORD_ dwDesiredAccess,
boost::detail::winapi::BOOL_ bInheritHandle,
boost::detail::winapi::LPCSTR_ lpName);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
CreateSemaphoreW(
::_SECURITY_ATTRIBUTES* lpSemaphoreAttributes,
boost::detail::winapi::LONG_ lInitialCount,
boost::detail::winapi::LONG_ lMaximumCount,
boost::detail::winapi::LPCWSTR_ lpName);
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
CreateSemaphoreExW(
::_SECURITY_ATTRIBUTES* lpSemaphoreAttributes,
boost::detail::winapi::LONG_ lInitialCount,
boost::detail::winapi::LONG_ lMaximumCount,
boost::detail::winapi::LPCWSTR_ lpName,
boost::detail::winapi::DWORD_ dwFlags,
boost::detail::winapi::DWORD_ dwDesiredAccess);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
OpenSemaphoreW(
boost::detail::winapi::DWORD_ dwDesiredAccess,
boost::detail::winapi::BOOL_ bInheritHandle,
boost::detail::winapi::LPCWSTR_ lpName);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
ReleaseSemaphore(
boost::detail::winapi::HANDLE_ hSemaphore,
boost::detail::winapi::LONG_ lReleaseCount,
boost::detail::winapi::LPLONG_ lpPreviousCount);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
#if !defined( BOOST_NO_ANSI_APIS )
using ::OpenSemaphoreA;
#endif
using ::OpenSemaphoreW;
using ::ReleaseSemaphore;
#if defined( BOOST_USE_WINDOWS_H )
const DWORD_ SEMAPHORE_ALL_ACCESS_ = SEMAPHORE_ALL_ACCESS;
const DWORD_ SEMAPHORE_MODIFY_STATE_ = SEMAPHORE_MODIFY_STATE;
#else // defined( BOOST_USE_WINDOWS_H )
const DWORD_ SEMAPHORE_ALL_ACCESS_ = 0x001F0003;
const DWORD_ SEMAPHORE_MODIFY_STATE_ = 0x00000002;
#endif // defined( BOOST_USE_WINDOWS_H )
// Undocumented and not present in Windows SDK. Enables NtQuerySemaphore.
// http://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FNT%20Objects%2FEvent%2FNtQueryEvent.html
const DWORD_ SEMAPHORE_QUERY_STATE_ = 0x00000001;
const DWORD_ semaphore_all_access = SEMAPHORE_ALL_ACCESS_;
const DWORD_ semaphore_modify_state = SEMAPHORE_MODIFY_STATE_;
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE HANDLE_ CreateSemaphoreA(SECURITY_ATTRIBUTES_* lpSemaphoreAttributes, LONG_ lInitialCount, LONG_ lMaximumCount, LPCSTR_ lpName)
{
#if BOOST_PLAT_WINDOWS_RUNTIME && BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
return ::CreateSemaphoreExA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSemaphoreAttributes), lInitialCount, lMaximumCount, lpName, 0, semaphore_all_access);
#else
return ::CreateSemaphoreA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSemaphoreAttributes), lInitialCount, lMaximumCount, lpName);
#endif
}
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
BOOST_FORCEINLINE HANDLE_ CreateSemaphoreExA(SECURITY_ATTRIBUTES_* lpSemaphoreAttributes, LONG_ lInitialCount, LONG_ lMaximumCount, LPCSTR_ lpName, DWORD_ dwFlags, DWORD_ dwDesiredAccess)
{
return ::CreateSemaphoreExA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSemaphoreAttributes), lInitialCount, lMaximumCount, lpName, dwFlags, dwDesiredAccess);
}
#endif
#endif
BOOST_FORCEINLINE HANDLE_ CreateSemaphoreW(SECURITY_ATTRIBUTES_* lpSemaphoreAttributes, LONG_ lInitialCount, LONG_ lMaximumCount, LPCWSTR_ lpName)
{
#if BOOST_PLAT_WINDOWS_RUNTIME && BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
return ::CreateSemaphoreExW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSemaphoreAttributes), lInitialCount, lMaximumCount, lpName, 0, semaphore_all_access);
#else
return ::CreateSemaphoreW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSemaphoreAttributes), lInitialCount, lMaximumCount, lpName);
#endif
}
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
BOOST_FORCEINLINE HANDLE_ CreateSemaphoreExW(SECURITY_ATTRIBUTES_* lpSemaphoreAttributes, LONG_ lInitialCount, LONG_ lMaximumCount, LPCWSTR_ lpName, DWORD_ dwFlags, DWORD_ dwDesiredAccess)
{
return ::CreateSemaphoreExW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpSemaphoreAttributes), lInitialCount, lMaximumCount, lpName, dwFlags, dwDesiredAccess);
}
#endif
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE HANDLE_ create_semaphore(SECURITY_ATTRIBUTES_* lpSemaphoreAttributes, LONG_ lInitialCount, LONG_ lMaximumCount, LPCSTR_ lpName)
{
return winapi::CreateSemaphoreA(lpSemaphoreAttributes, lInitialCount, lMaximumCount, lpName);
}
BOOST_FORCEINLINE HANDLE_ open_semaphore(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCSTR_ lpName)
{
return ::OpenSemaphoreA(dwDesiredAccess, bInheritHandle, lpName);
}
#endif
BOOST_FORCEINLINE HANDLE_ create_semaphore(SECURITY_ATTRIBUTES_* lpSemaphoreAttributes, LONG_ lInitialCount, LONG_ lMaximumCount, LPCWSTR_ lpName)
{
return winapi::CreateSemaphoreW(lpSemaphoreAttributes, lInitialCount, lMaximumCount, lpName);
}
BOOST_FORCEINLINE HANDLE_ open_semaphore(DWORD_ dwDesiredAccess, BOOL_ bInheritHandle, LPCWSTR_ lpName)
{
return ::OpenSemaphoreW(dwDesiredAccess, bInheritHandle, lpName);
}
BOOST_FORCEINLINE HANDLE_ create_anonymous_semaphore(SECURITY_ATTRIBUTES_* lpSemaphoreAttributes, LONG_ lInitialCount, LONG_ lMaximumCount)
{
return winapi::CreateSemaphoreW(lpSemaphoreAttributes, lInitialCount, lMaximumCount, 0);
}
}
}
}
#endif // BOOST_DETAIL_WINAPI_SEMAPHORE_HPP
@@ -0,0 +1,145 @@
// shell.hpp --------------------------------------------------------------//
// Copyright 2016 Klemens D. Morgenstern
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_SHELL_HPP_
#define BOOST_DETAIL_WINAPI_SHELL_HPP_
#include <boost/detail/winapi/basic_types.hpp>
#include <boost/detail/winapi/limits.hpp>
#if defined( BOOST_USE_WINDOWS_H )
#include <shellapi.h>
#endif
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
BOOST_DETAIL_WINAPI_DECLARE_HANDLE(HICON);
#if !defined( BOOST_NO_ANSI_APIS )
struct _SHFILEINFOA;
#endif
struct _SHFILEINFOW;
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_PTR_ WINAPI SHGetFileInfoA(
boost::detail::winapi::LPCSTR_ pszPath,
boost::detail::winapi::DWORD_ dwFileAttributes,
::_SHFILEINFOA *psfinsigned,
boost::detail::winapi::UINT_ cbFileInfons,
boost::detail::winapi::UINT_ uFlags);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_PTR_ WINAPI SHGetFileInfoW(
boost::detail::winapi::LPCWSTR_ pszPath,
boost::detail::winapi::DWORD_ dwFileAttributes,
::_SHFILEINFOW *psfinsigned,
boost::detail::winapi::UINT_ cbFileInfons,
boost::detail::winapi::UINT_ uFlags);
} // extern "C"
#endif // !defined( BOOST_USE_WINDOWS_H )
namespace boost {
namespace detail {
namespace winapi {
typedef ::HICON HICON_;
#if defined( BOOST_USE_WINDOWS_H )
const DWORD_ SHGFI_ICON_ = SHGFI_ICON;
const DWORD_ SHGFI_DISPLAYNAME_ = SHGFI_DISPLAYNAME;
const DWORD_ SHGFI_TYPENAME_ = SHGFI_TYPENAME;
const DWORD_ SHGFI_ATTRIBUTES_ = SHGFI_ATTRIBUTES;
const DWORD_ SHGFI_ICONLOCATION_ = SHGFI_ICONLOCATION;
const DWORD_ SHGFI_EXETYPE_ = SHGFI_EXETYPE;
const DWORD_ SHGFI_SYSICONINDEX_ = SHGFI_SYSICONINDEX;
const DWORD_ SHGFI_LINKOVERLAY_ = SHGFI_LINKOVERLAY;
const DWORD_ SHGFI_SELECTED_ = SHGFI_SELECTED;
const DWORD_ SHGFI_ATTR_SPECIFIED_ = SHGFI_ATTR_SPECIFIED;
const DWORD_ SHGFI_LARGEICON_ = SHGFI_LARGEICON;
const DWORD_ SHGFI_SMALLICON_ = SHGFI_SMALLICON;
const DWORD_ SHGFI_OPENICON_ = SHGFI_OPENICON;
const DWORD_ SHGFI_SHELLICONSIZE_ = SHGFI_SHELLICONSIZE;
const DWORD_ SHGFI_PIDL_ = SHGFI_PIDL;
const DWORD_ SHGFI_USEFILEATTRIBUTES_ = SHGFI_USEFILEATTRIBUTES;
#else // defined( BOOST_USE_WINDOWS_H )
const DWORD_ SHGFI_ICON_ = 0x000000100;
const DWORD_ SHGFI_DISPLAYNAME_ = 0x000000200;
const DWORD_ SHGFI_TYPENAME_ = 0x000000400;
const DWORD_ SHGFI_ATTRIBUTES_ = 0x000000800;
const DWORD_ SHGFI_ICONLOCATION_ = 0x000001000;
const DWORD_ SHGFI_EXETYPE_ = 0x000002000;
const DWORD_ SHGFI_SYSICONINDEX_ = 0x000004000;
const DWORD_ SHGFI_LINKOVERLAY_ = 0x000008000;
const DWORD_ SHGFI_SELECTED_ = 0x000010000;
const DWORD_ SHGFI_ATTR_SPECIFIED_ = 0x000020000;
const DWORD_ SHGFI_LARGEICON_ = 0x000000000;
const DWORD_ SHGFI_SMALLICON_ = 0x000000001;
const DWORD_ SHGFI_OPENICON_ = 0x000000002;
const DWORD_ SHGFI_SHELLICONSIZE_ = 0x000000004;
const DWORD_ SHGFI_PIDL_ = 0x000000008;
const DWORD_ SHGFI_USEFILEATTRIBUTES_ = 0x000000010;
#endif // defined( BOOST_USE_WINDOWS_H )
// These constants are only declared for _WIN32_IE >= 0x0500. We don't set IE version
// and 5.0 is the default version since NT4 SP6, so just define the constants unconditionally.
const DWORD_ SHGFI_ADDOVERLAYS_ = 0x000000020;
const DWORD_ SHGFI_OVERLAYINDEX_ = 0x000000040;
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _SHFILEINFOA {
HICON_ hIcon;
int iIcon;
DWORD_ dwAttributes;
CHAR_ szDisplayName[MAX_PATH_];
CHAR_ szTypeName[80];
} SHFILEINFOA_;
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _SHFILEINFOW {
HICON_ hIcon;
int iIcon;
DWORD_ dwAttributes;
WCHAR_ szDisplayName[MAX_PATH_];
WCHAR_ szTypeName[80];
} SHFILEINFOW_;
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE DWORD_PTR_ SHGetFileInfoA(LPCSTR_ pszPath, DWORD_ dwFileAttributes, SHFILEINFOA_* psfinsigned, UINT_ cbFileInfons, UINT_ uFlags)
{
return ::SHGetFileInfoA(pszPath, dwFileAttributes, reinterpret_cast< ::_SHFILEINFOA* >(psfinsigned), cbFileInfons, uFlags);
}
BOOST_FORCEINLINE DWORD_PTR_ sh_get_file_info(LPCSTR_ pszPath, DWORD_ dwFileAttributes, SHFILEINFOA_* psfinsigned, UINT_ cbFileInfons, UINT_ uFlags)
{
return ::SHGetFileInfoA(pszPath, dwFileAttributes, reinterpret_cast< ::_SHFILEINFOA* >(psfinsigned), cbFileInfons, uFlags);
}
#endif // BOOST_NO_ANSI_APIS
BOOST_FORCEINLINE DWORD_PTR_ SHGetFileInfoW(LPCWSTR_ pszPath, DWORD_ dwFileAttributes, SHFILEINFOW_* psfinsigned, UINT_ cbFileInfons, UINT_ uFlags)
{
return ::SHGetFileInfoW(pszPath, dwFileAttributes, reinterpret_cast< ::_SHFILEINFOW* >(psfinsigned), cbFileInfons, uFlags);
}
BOOST_FORCEINLINE DWORD_PTR_ sh_get_file_info(LPCWSTR_ pszPath, DWORD_ dwFileAttributes, SHFILEINFOW_* psfinsigned, UINT_ cbFileInfons, UINT_ uFlags)
{
return ::SHGetFileInfoW(pszPath, dwFileAttributes, reinterpret_cast< ::_SHFILEINFOW* >(psfinsigned), cbFileInfons, uFlags);
}
}
}
}
#endif // BOOST_DETAIL_WINAPI_SHELL_HPP_
@@ -0,0 +1,105 @@
// show_window.hpp --------------------------------------------------------------//
// Copyright 2016 Klemens D. Morgenstern
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_SHOW_WINDOW_HPP_
#define BOOST_DETAIL_WINAPI_SHOW_WINDOW_HPP_
#include <boost/detail/winapi/basic_types.hpp>
#include <boost/predef/platform.h>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if BOOST_PLAT_WINDOWS_DESKTOP
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
BOOST_DETAIL_WINAPI_DECLARE_HANDLE(HWND);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI ShowWindow(
HWND hWnd,
int nCmdShow);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI ShowWindowAsync(
HWND hWnd,
int nCmdShow);
}
#endif // BOOST_USE_WINDOWS_H
namespace boost {
namespace detail {
namespace winapi {
typedef ::HWND HWND_;
using ::ShowWindow;
using ::ShowWindowAsync;
#if defined( BOOST_USE_WINDOWS_H ) && !defined( NOSHOWWINDOW )
const DWORD_ SW_HIDE_ = SW_HIDE;
const DWORD_ SW_SHOWNORMAL_ = SW_SHOWNORMAL;
const DWORD_ SW_NORMAL_ = SW_NORMAL;
const DWORD_ SW_SHOWMINIMIZED_ = SW_SHOWMINIMIZED;
const DWORD_ SW_SHOWMAXIMIZED_ = SW_SHOWMAXIMIZED;
const DWORD_ SW_MAXIMIZE_ = SW_MAXIMIZE;
const DWORD_ SW_SHOWNOACTIVATE_ = SW_SHOWNOACTIVATE;
const DWORD_ SW_SHOW_ = SW_SHOW;
const DWORD_ SW_MINIMIZE_ = SW_MINIMIZE;
const DWORD_ SW_SHOWMINNOACTIVE_ = SW_SHOWMINNOACTIVE;
const DWORD_ SW_SHOWNA_ = SW_SHOWNA;
const DWORD_ SW_RESTORE_ = SW_RESTORE;
const DWORD_ SW_SHOWDEFAULT_ = SW_SHOWDEFAULT;
const DWORD_ SW_FORCEMINIMIZE_ = SW_FORCEMINIMIZE;
const DWORD_ SW_MAX_ = SW_MAX;
const DWORD_ HIDE_WINDOW_ = HIDE_WINDOW;
const DWORD_ SHOW_OPENWINDOW_ = SHOW_OPENWINDOW;
const DWORD_ SHOW_ICONWINDOW_ = SHOW_ICONWINDOW;
const DWORD_ SHOW_FULLSCREEN_ = SHOW_FULLSCREEN;
const DWORD_ SHOW_OPENNOACTIVATE_ = SHOW_OPENNOACTIVATE;
const DWORD_ SW_PARENTCLOSING_ = SW_PARENTCLOSING;
const DWORD_ SW_OTHERZOOM_ = SW_OTHERZOOM;
const DWORD_ SW_PARENTOPENING_ = SW_PARENTOPENING;
const DWORD_ SW_OTHERUNZOOM_ = SW_OTHERUNZOOM;
#else
const DWORD_ SW_HIDE_ = 0;
const DWORD_ SW_SHOWNORMAL_ = 1;
const DWORD_ SW_NORMAL_ = 1;
const DWORD_ SW_SHOWMINIMIZED_ = 2;
const DWORD_ SW_SHOWMAXIMIZED_ = 3;
const DWORD_ SW_MAXIMIZE_ = 3;
const DWORD_ SW_SHOWNOACTIVATE_ = 4;
const DWORD_ SW_SHOW_ = 5;
const DWORD_ SW_MINIMIZE_ = 6;
const DWORD_ SW_SHOWMINNOACTIVE_ = 7;
const DWORD_ SW_SHOWNA_ = 8;
const DWORD_ SW_RESTORE_ = 9;
const DWORD_ SW_SHOWDEFAULT_ = 10;
const DWORD_ SW_FORCEMINIMIZE_ = 11;
const DWORD_ SW_MAX_ = 11;
const DWORD_ HIDE_WINDOW_ = 0;
const DWORD_ SHOW_OPENWINDOW_ = 1;
const DWORD_ SHOW_ICONWINDOW_ = 2;
const DWORD_ SHOW_FULLSCREEN_ = 3;
const DWORD_ SHOW_OPENNOACTIVATE_ = 4;
const DWORD_ SW_PARENTCLOSING_ = 1;
const DWORD_ SW_OTHERZOOM_ = 2;
const DWORD_ SW_PARENTOPENING_ = 3;
const DWORD_ SW_OTHERUNZOOM_ = 4;
#endif
}
}
}
#endif // BOOST_PLAT_WINDOWS_DESKTOP
#endif // BOOST_DETAIL_WINAPI_SHOW_WINDOW_HPP_
@@ -0,0 +1,116 @@
// srw_lock.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_SRW_LOCK_HPP
#define BOOST_DETAIL_WINAPI_SRW_LOCK_HPP
#include <boost/detail/winapi/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_WIN6 \
|| (defined(_MSC_VER) && _MSC_VER < 1600)
// Windows SDK 6.0A, which is used by MSVC 9, does not have TryAcquireSRWLock* neither in headers nor in .lib files,
// although the functions are present in later SDKs since Windows API version 6.
#define BOOST_WINAPI_NO_TRY_ACQUIRE_SRWLOCK
#endif
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
#include <boost/detail/winapi/basic_types.hpp>
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
struct _RTL_SRWLOCK;
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
InitializeSRWLock(::_RTL_SRWLOCK* SRWLock);
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
ReleaseSRWLockExclusive(::_RTL_SRWLOCK* SRWLock);
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
ReleaseSRWLockShared(::_RTL_SRWLOCK* SRWLock);
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
AcquireSRWLockExclusive(::_RTL_SRWLOCK* SRWLock);
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
AcquireSRWLockShared(::_RTL_SRWLOCK* SRWLock);
#if !defined( BOOST_WINAPI_NO_TRY_ACQUIRE_SRWLOCK )
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOLEAN_ WINAPI
TryAcquireSRWLockExclusive(::_RTL_SRWLOCK* SRWLock);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOLEAN_ WINAPI
TryAcquireSRWLockShared(::_RTL_SRWLOCK* SRWLock);
#endif
}
#endif
namespace boost {
namespace detail {
namespace winapi {
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _RTL_SRWLOCK {
PVOID_ Ptr;
} SRWLOCK_, *PSRWLOCK_;
#if defined( BOOST_USE_WINDOWS_H )
#define BOOST_DETAIL_WINAPI_SRWLOCK_INIT SRWLOCK_INIT
#else
#define BOOST_DETAIL_WINAPI_SRWLOCK_INIT {0}
#endif
BOOST_FORCEINLINE VOID_ InitializeSRWLock(PSRWLOCK_ SRWLock)
{
::InitializeSRWLock(reinterpret_cast< ::_RTL_SRWLOCK* >(SRWLock));
}
BOOST_FORCEINLINE VOID_ ReleaseSRWLockExclusive(PSRWLOCK_ SRWLock)
{
::ReleaseSRWLockExclusive(reinterpret_cast< ::_RTL_SRWLOCK* >(SRWLock));
}
BOOST_FORCEINLINE VOID_ ReleaseSRWLockShared(PSRWLOCK_ SRWLock)
{
::ReleaseSRWLockShared(reinterpret_cast< ::_RTL_SRWLOCK* >(SRWLock));
}
BOOST_FORCEINLINE VOID_ AcquireSRWLockExclusive(PSRWLOCK_ SRWLock)
{
::AcquireSRWLockExclusive(reinterpret_cast< ::_RTL_SRWLOCK* >(SRWLock));
}
BOOST_FORCEINLINE VOID_ AcquireSRWLockShared(PSRWLOCK_ SRWLock)
{
::AcquireSRWLockShared(reinterpret_cast< ::_RTL_SRWLOCK* >(SRWLock));
}
#if !defined( BOOST_WINAPI_NO_TRY_ACQUIRE_SRWLOCK )
BOOST_FORCEINLINE BOOLEAN_ TryAcquireSRWLockExclusive(PSRWLOCK_ SRWLock)
{
return ::TryAcquireSRWLockExclusive(reinterpret_cast< ::_RTL_SRWLOCK* >(SRWLock));
}
BOOST_FORCEINLINE BOOLEAN_ TryAcquireSRWLockShared(PSRWLOCK_ SRWLock)
{
return ::TryAcquireSRWLockShared(reinterpret_cast< ::_RTL_SRWLOCK* >(SRWLock));
}
#endif
}
}
}
#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
#endif // BOOST_DETAIL_WINAPI_SRW_LOCK_HPP
@@ -0,0 +1,28 @@
// synchronizaion.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_SYNCHRONIZATION_HPP
#define BOOST_DETAIL_WINAPI_SYNCHRONIZATION_HPP
#include <boost/detail/winapi/basic_types.hpp>
#include <boost/detail/winapi/critical_section.hpp>
#include <boost/detail/winapi/wait.hpp>
#include <boost/detail/winapi/event.hpp>
#include <boost/detail/winapi/mutex.hpp>
#include <boost/detail/winapi/semaphore.hpp>
#include <boost/detail/winapi/init_once.hpp>
#include <boost/detail/winapi/srw_lock.hpp>
#include <boost/detail/winapi/condition_variable.hpp>
#include <boost/detail/winapi/apc.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#endif // BOOST_DETAIL_WINAPI_SYNCHRONIZATION_HPP
@@ -0,0 +1,83 @@
// system.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright (c) Microsoft Corporation 2014
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_SYSTEM_HPP
#define BOOST_DETAIL_WINAPI_SYSTEM_HPP
#include <boost/detail/winapi/basic_types.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if defined(BOOST_MSVC)
#pragma warning(push)
// nonstandard extension used : nameless struct/union
#pragma warning(disable: 4201)
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
struct _SYSTEM_INFO;
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
GetSystemInfo(::_SYSTEM_INFO* lpSystemInfo);
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WINXP
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
GetNativeSystemInfo(::_SYSTEM_INFO* lpSystemInfo);
#endif
}
#endif
namespace boost {
namespace detail {
namespace winapi {
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _SYSTEM_INFO {
union {
DWORD_ dwOemId;
struct {
WORD_ wProcessorArchitecture;
WORD_ wReserved;
} DUMMYSTRUCTNAME;
} DUMMYUNIONNAME;
DWORD_ dwPageSize;
LPVOID_ lpMinimumApplicationAddress;
LPVOID_ lpMaximumApplicationAddress;
DWORD_PTR_ dwActiveProcessorMask;
DWORD_ dwNumberOfProcessors;
DWORD_ dwProcessorType;
DWORD_ dwAllocationGranularity;
WORD_ wProcessorLevel;
WORD_ wProcessorRevision;
} SYSTEM_INFO_, *LPSYSTEM_INFO_;
BOOST_FORCEINLINE VOID_ GetSystemInfo(LPSYSTEM_INFO_ lpSystemInfo)
{
::GetSystemInfo(reinterpret_cast< ::_SYSTEM_INFO* >(lpSystemInfo));
}
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WINXP
BOOST_FORCEINLINE VOID_ GetNativeSystemInfo(LPSYSTEM_INFO_ lpSystemInfo)
{
::GetNativeSystemInfo(reinterpret_cast< ::_SYSTEM_INFO* >(lpSystemInfo));
}
#endif
}
}
}
#if defined(BOOST_MSVC)
#pragma warning(pop)
#endif
#endif // BOOST_DETAIL_WINAPI_SYSTEM_HPP
@@ -0,0 +1,42 @@
// thread.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 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_HPP
#define BOOST_DETAIL_WINAPI_THREAD_HPP
#include <boost/detail/winapi/basic_types.hpp>
#include <boost/detail/winapi/get_current_thread.hpp>
#include <boost/detail/winapi/get_current_thread_id.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
SleepEx(
boost::detail::winapi::DWORD_ dwMilliseconds,
boost::detail::winapi::BOOL_ bAlertable);
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI Sleep(boost::detail::winapi::DWORD_ dwMilliseconds);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI SwitchToThread(BOOST_DETAIL_WINAPI_VOID);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
using ::SleepEx;
using ::Sleep;
using ::SwitchToThread;
}
}
}
#endif // BOOST_DETAIL_WINAPI_THREAD_HPP
@@ -0,0 +1,126 @@
// 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/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN2K
#include <boost/detail/winapi/basic_types.hpp>
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
typedef boost::detail::winapi::VOID_ (NTAPI *WAITORTIMERCALLBACKFUNC)
(boost::detail::winapi::PVOID_, boost::detail::winapi::BOOLEAN_);
typedef WAITORTIMERCALLBACKFUNC WAITORTIMERCALLBACK;
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
RegisterWaitForSingleObject(
boost::detail::winapi::PHANDLE_ phNewWaitObject,
boost::detail::winapi::HANDLE_ hObject,
WAITORTIMERCALLBACK Callback,
boost::detail::winapi::PVOID_ Context,
boost::detail::winapi::ULONG_ dwMilliseconds,
boost::detail::winapi::ULONG_ dwFlags);
}
#endif
// MinGW is buggy - it is missing these function declarations for Win2000
#if !defined( BOOST_USE_WINDOWS_H ) || (defined(BOOST_WINAPI_IS_MINGW) && BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_WINXP)
extern "C" {
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
UnregisterWait(boost::detail::winapi::HANDLE_ WaitHandle);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
UnregisterWaitEx(
boost::detail::winapi::HANDLE_ WaitHandle,
boost::detail::winapi::HANDLE_ CompletionEvent);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
typedef ::WAITORTIMERCALLBACKFUNC WAITORTIMERCALLBACKFUNC_;
typedef ::WAITORTIMERCALLBACK WAITORTIMERCALLBACK_;
using ::RegisterWaitForSingleObject;
using ::UnregisterWait;
using ::UnregisterWaitEx;
#if defined( BOOST_USE_WINDOWS_H )
const ULONG_ WT_EXECUTEDEFAULT_ = WT_EXECUTEDEFAULT;
const ULONG_ WT_EXECUTEINIOTHREAD_ = WT_EXECUTEINIOTHREAD;
#if defined( BOOST_WINAPI_IS_MINGW )
const ULONG_ WT_EXECUTEINUITHREAD_ = 0x00000002;
#else
const ULONG_ WT_EXECUTEINUITHREAD_ = WT_EXECUTEINUITHREAD;
#endif
const ULONG_ WT_EXECUTEINWAITTHREAD_ = WT_EXECUTEINWAITTHREAD;
const ULONG_ WT_EXECUTEONLYONCE_ = WT_EXECUTEONLYONCE;
const ULONG_ WT_EXECUTEINTIMERTHREAD_ = WT_EXECUTEINTIMERTHREAD;
const ULONG_ WT_EXECUTELONGFUNCTION_ = WT_EXECUTELONGFUNCTION;
#if defined( BOOST_WINAPI_IS_MINGW )
const ULONG_ WT_EXECUTEINPERSISTENTIOTHREAD_ = 0x00000040;
#else
const ULONG_ WT_EXECUTEINPERSISTENTIOTHREAD_ = WT_EXECUTEINPERSISTENTIOTHREAD;
#endif
const ULONG_ WT_EXECUTEINPERSISTENTTHREAD_ = 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 // defined( BOOST_USE_WINDOWS_H )
const ULONG_ WT_EXECUTEDEFAULT_ = 0x00000000;
const ULONG_ WT_EXECUTEINIOTHREAD_ = 0x00000001;
const ULONG_ WT_EXECUTEINUITHREAD_ = 0x00000002;
const ULONG_ WT_EXECUTEINWAITTHREAD_ = 0x00000004;
const ULONG_ WT_EXECUTEONLYONCE_ = 0x00000008;
const ULONG_ WT_EXECUTEINTIMERTHREAD_ = 0x00000020;
const ULONG_ WT_EXECUTELONGFUNCTION_ = 0x00000010;
const ULONG_ WT_EXECUTEINPERSISTENTIOTHREAD_ = 0x00000040;
const ULONG_ WT_EXECUTEINPERSISTENTTHREAD_ = 0x00000080;
const ULONG_ WT_TRANSFER_IMPERSONATION_ = 0x00000100;
inline ULONG_ wt_set_max_threadpool_threads(ULONG_ flags, ULONG_ limit)
{
return flags | (limit << 16);
}
#endif // defined( BOOST_USE_WINDOWS_H )
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_;
}
}
}
#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN2K
#endif // BOOST_DETAIL_WINAPI_THREAD_POOL_HPP
@@ -0,0 +1,139 @@
// time.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright (c) Microsoft Corporation 2014
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_TIME_HPP
#define BOOST_DETAIL_WINAPI_TIME_HPP
#include <boost/detail/winapi/basic_types.hpp>
#include <boost/predef/platform.h>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
struct _FILETIME;
struct _SYSTEMTIME;
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
GetSystemTime(::_SYSTEMTIME* lpSystemTime);
#ifdef BOOST_HAS_GETSYSTEMTIMEASFILETIME // Windows CE does not define GetSystemTimeAsFileTime
BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI
GetSystemTimeAsFileTime(::_FILETIME* lpSystemTimeAsFileTime);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
SystemTimeToFileTime(
const ::_SYSTEMTIME* lpSystemTime,
::_FILETIME* lpFileTime);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
FileTimeToSystemTime(
const ::_FILETIME* lpFileTime,
::_SYSTEMTIME* lpSystemTime);
#if BOOST_PLAT_WINDOWS_DESKTOP
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
FileTimeToLocalFileTime(
const ::_FILETIME* lpFileTime,
::_FILETIME* lpLocalFileTime);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
LocalFileTimeToFileTime(
const ::_FILETIME* lpLocalFileTime,
::_FILETIME* lpFileTime);
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
GetTickCount(BOOST_DETAIL_WINAPI_VOID);
#endif
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
BOOST_SYMBOL_IMPORT boost::detail::winapi::ULONGLONG_ WINAPI
GetTickCount64(BOOST_DETAIL_WINAPI_VOID);
#endif
}
#endif
namespace boost {
namespace detail {
namespace winapi {
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _FILETIME {
DWORD_ dwLowDateTime;
DWORD_ dwHighDateTime;
} FILETIME_, *PFILETIME_, *LPFILETIME_;
typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _SYSTEMTIME {
WORD_ wYear;
WORD_ wMonth;
WORD_ wDayOfWeek;
WORD_ wDay;
WORD_ wHour;
WORD_ wMinute;
WORD_ wSecond;
WORD_ wMilliseconds;
} SYSTEMTIME_, *PSYSTEMTIME_, *LPSYSTEMTIME_;
#if BOOST_PLAT_WINDOWS_DESKTOP
using ::GetTickCount;
#endif
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
using ::GetTickCount64;
#endif
BOOST_FORCEINLINE VOID_ GetSystemTime(LPSYSTEMTIME_ lpSystemTime)
{
::GetSystemTime(reinterpret_cast< ::_SYSTEMTIME* >(lpSystemTime));
}
#if defined( BOOST_HAS_GETSYSTEMTIMEASFILETIME )
BOOST_FORCEINLINE VOID_ GetSystemTimeAsFileTime(LPFILETIME_ lpSystemTimeAsFileTime)
{
::GetSystemTimeAsFileTime(reinterpret_cast< ::_FILETIME* >(lpSystemTimeAsFileTime));
}
#else
// Windows CE does not define GetSystemTimeAsFileTime
BOOST_FORCEINLINE VOID_ GetSystemTimeAsFileTime(FILETIME_* lpFileTime)
{
boost::detail::winapi::SYSTEMTIME_ st;
boost::detail::winapi::GetSystemTime(&st);
boost::detail::winapi::SystemTimeToFileTime(&st, lpFileTime);
}
#endif
BOOST_FORCEINLINE BOOL_ SystemTimeToFileTime(const SYSTEMTIME_* lpSystemTime, FILETIME_* lpFileTime)
{
return ::SystemTimeToFileTime(reinterpret_cast< const ::_SYSTEMTIME* >(lpSystemTime), reinterpret_cast< ::_FILETIME* >(lpFileTime));
}
BOOST_FORCEINLINE BOOL_ FileTimeToSystemTime(const FILETIME_* lpFileTime, SYSTEMTIME_* lpSystemTime)
{
return ::FileTimeToSystemTime(reinterpret_cast< const ::_FILETIME* >(lpFileTime), reinterpret_cast< ::_SYSTEMTIME* >(lpSystemTime));
}
#if BOOST_PLAT_WINDOWS_DESKTOP
BOOST_FORCEINLINE BOOL_ FileTimeToLocalFileTime(const FILETIME_* lpFileTime, FILETIME_* lpLocalFileTime)
{
return ::FileTimeToLocalFileTime(reinterpret_cast< const ::_FILETIME* >(lpFileTime), reinterpret_cast< ::_FILETIME* >(lpLocalFileTime));
}
BOOST_FORCEINLINE BOOL_ LocalFileTimeToFileTime(const FILETIME_* lpLocalFileTime, FILETIME_* lpFileTime)
{
return ::LocalFileTimeToFileTime(reinterpret_cast< const ::_FILETIME* >(lpLocalFileTime), reinterpret_cast< ::_FILETIME* >(lpFileTime));
}
#endif
}
}
}
#endif // BOOST_DETAIL_WINAPI_TIME_HPP
@@ -0,0 +1,48 @@
// timers.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_TIMERS_HPP
#define BOOST_DETAIL_WINAPI_TIMERS_HPP
#include <boost/detail/winapi/basic_types.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
QueryPerformanceCounter(::_LARGE_INTEGER* lpPerformanceCount);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
QueryPerformanceFrequency(::_LARGE_INTEGER* lpFrequency);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
BOOST_FORCEINLINE BOOL_ QueryPerformanceCounter(LARGE_INTEGER_* lpPerformanceCount)
{
return ::QueryPerformanceCounter(reinterpret_cast< ::_LARGE_INTEGER* >(lpPerformanceCount));
}
BOOST_FORCEINLINE BOOL_ QueryPerformanceFrequency(LARGE_INTEGER_* lpFrequency)
{
return ::QueryPerformanceFrequency(reinterpret_cast< ::_LARGE_INTEGER* >(lpFrequency));
}
}
}
}
#endif // BOOST_DETAIL_WINAPI_TIMERS_HPP
@@ -0,0 +1,60 @@
// 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
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
#if !defined( UNDER_CE )
// Windows CE define TlsAlloc and TlsFree as inline functions in kfuncs.h
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
TlsAlloc(BOOST_DETAIL_WINAPI_VOID);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
TlsFree(boost::detail::winapi::DWORD_ dwTlsIndex);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::LPVOID_ WINAPI
TlsGetValue(boost::detail::winapi::DWORD_ dwTlsIndex);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
TlsSetValue(
boost::detail::winapi::DWORD_ dwTlsIndex,
boost::detail::winapi::LPVOID_ lpTlsValue);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
using ::TlsAlloc;
using ::TlsFree;
using ::TlsGetValue;
using ::TlsSetValue;
#if defined( BOOST_USE_WINDOWS_H )
const DWORD_ TLS_OUT_OF_INDEXES_ = TLS_OUT_OF_INDEXES;
#else
const DWORD_ TLS_OUT_OF_INDEXES_ = 0xFFFFFFFF;
#endif
const DWORD_ tls_out_of_indexes = TLS_OUT_OF_INDEXES_;
}
}
}
#endif // BOOST_DETAIL_WINAPI_TLS_HPP
@@ -0,0 +1,84 @@
// wait.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_DETAIL_WINAPI_WAIT_HPP
#define BOOST_DETAIL_WINAPI_WAIT_HPP
#include <boost/detail/winapi/basic_types.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
WaitForSingleObject(
boost::detail::winapi::HANDLE_ hHandle,
boost::detail::winapi::DWORD_ dwMilliseconds);
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
WaitForMultipleObjects(
boost::detail::winapi::DWORD_ nCount,
boost::detail::winapi::HANDLE_ const* lpHandles,
boost::detail::winapi::BOOL_ bWaitAll,
boost::detail::winapi::DWORD_ dwMilliseconds);
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4
BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
SignalObjectAndWait(
boost::detail::winapi::HANDLE_ hObjectToSignal,
boost::detail::winapi::HANDLE_ hObjectToWaitOn,
boost::detail::winapi::DWORD_ dwMilliseconds,
boost::detail::winapi::BOOL_ bAlertable);
#endif
}
#endif
namespace boost {
namespace detail {
namespace winapi {
using ::WaitForMultipleObjects;
using ::WaitForSingleObject;
#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4
using ::SignalObjectAndWait;
#endif
#if defined( BOOST_USE_WINDOWS_H )
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;
#else // defined( BOOST_USE_WINDOWS_H )
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;
#endif // defined( BOOST_USE_WINDOWS_H )
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_;
const DWORD_ max_non_infinite_wait = (DWORD_)0xFFFFFFFE;
}
}
}
#endif // BOOST_DETAIL_WINAPI_WAIT_HPP
@@ -0,0 +1,145 @@
// 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
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" {
typedef boost::detail::winapi::VOID_
(WINAPI *PTIMERAPCROUTINE)(
boost::detail::winapi::LPVOID_ lpArgToCompletionRoutine,
boost::detail::winapi::DWORD_ dwTimerLowValue,
boost::detail::winapi::DWORD_ dwTimerHighValue);
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
CreateWaitableTimerA(
::_SECURITY_ATTRIBUTES* lpTimerAttributes,
boost::detail::winapi::BOOL_ bManualReset,
boost::detail::winapi::LPCSTR_ lpTimerName);
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
OpenWaitableTimerA(
boost::detail::winapi::DWORD_ dwDesiredAccess,
boost::detail::winapi::BOOL_ bInheritHandle,
boost::detail::winapi::LPCSTR_ lpTimerName);
#endif
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
CreateWaitableTimerW(
::_SECURITY_ATTRIBUTES* lpTimerAttributes,
boost::detail::winapi::BOOL_ bManualReset,
boost::detail::winapi::LPCWSTR_ lpTimerName);
BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI
OpenWaitableTimerW(
boost::detail::winapi::DWORD_ dwDesiredAccess,
boost::detail::winapi::BOOL_ bInheritHandle,
boost::detail::winapi::LPCWSTR_ lpTimerName);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
SetWaitableTimer(
boost::detail::winapi::HANDLE_ hTimer,
const ::_LARGE_INTEGER* lpDueTime,
boost::detail::winapi::LONG_ lPeriod,
PTIMERAPCROUTINE pfnCompletionRoutine,
boost::detail::winapi::LPVOID_ lpArgToCompletionRoutine,
boost::detail::winapi::BOOL_ fResume);
BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
CancelWaitableTimer(boost::detail::winapi::HANDLE_ hTimer);
}
#endif
namespace boost {
namespace detail {
namespace winapi {
typedef ::PTIMERAPCROUTINE PTIMERAPCROUTINE_;
#if !defined( BOOST_NO_ANSI_APIS )
using ::OpenWaitableTimerA;
#endif
using ::OpenWaitableTimerW;
using ::CancelWaitableTimer;
#if defined( BOOST_USE_WINDOWS_H )
const DWORD_ TIMER_ALL_ACCESS_ = TIMER_ALL_ACCESS;
const DWORD_ TIMER_MODIFY_STATE_ = TIMER_MODIFY_STATE;
const DWORD_ TIMER_QUERY_STATE_ = TIMER_QUERY_STATE;
#else // defined( BOOST_USE_WINDOWS_H )
const DWORD_ TIMER_ALL_ACCESS_ = 0x001F0003;
const DWORD_ TIMER_MODIFY_STATE_ = 0x00000002;
const DWORD_ TIMER_QUERY_STATE_ = 0x00000001;
#endif // defined( BOOST_USE_WINDOWS_H )
const DWORD_ timer_all_access = TIMER_ALL_ACCESS_;
const DWORD_ timer_modify_state = TIMER_MODIFY_STATE_;
const DWORD_ timer_query_state = TIMER_QUERY_STATE_;
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE HANDLE_ CreateWaitableTimerA(PSECURITY_ATTRIBUTES_ lpTimerAttributes, BOOL_ bManualReset, LPCSTR_ lpTimerName)
{
return ::CreateWaitableTimerA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpTimerAttributes), bManualReset, lpTimerName);
}
#endif
BOOST_FORCEINLINE HANDLE_ CreateWaitableTimerW(PSECURITY_ATTRIBUTES_ lpTimerAttributes, BOOL_ bManualReset, LPCWSTR_ lpTimerName)
{
return ::CreateWaitableTimerW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpTimerAttributes), bManualReset, lpTimerName);
}
BOOST_FORCEINLINE BOOL_ SetWaitableTimer(
HANDLE_ hTimer,
const LARGE_INTEGER_* lpDueTime,
LONG_ lPeriod,
PTIMERAPCROUTINE_ pfnCompletionRoutine,
LPVOID_ lpArgToCompletionRoutine,
BOOL_ fResume)
{
return ::SetWaitableTimer(hTimer, reinterpret_cast< const ::_LARGE_INTEGER* >(lpDueTime), lPeriod, pfnCompletionRoutine, lpArgToCompletionRoutine, fResume);
}
#if !defined( BOOST_NO_ANSI_APIS )
BOOST_FORCEINLINE HANDLE_ create_waitable_timer(PSECURITY_ATTRIBUTES_ lpTimerAttributes, BOOL_ bManualReset, LPCSTR_ lpTimerName)
{
return ::CreateWaitableTimerA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpTimerAttributes), bManualReset, lpTimerName);
}
#endif
BOOST_FORCEINLINE HANDLE_ create_waitable_timer(PSECURITY_ATTRIBUTES_ lpTimerAttributes, BOOL_ bManualReset, LPCWSTR_ lpTimerName)
{
return ::CreateWaitableTimerW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpTimerAttributes), bManualReset, lpTimerName);
}
BOOST_FORCEINLINE HANDLE_ create_anonymous_waitable_timer(PSECURITY_ATTRIBUTES_ lpTimerAttributes, BOOL_ bManualReset)
{
#ifdef BOOST_NO_ANSI_APIS
return ::CreateWaitableTimerW(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpTimerAttributes), bManualReset, 0);
#else
return ::CreateWaitableTimerA(reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpTimerAttributes), bManualReset, 0);
#endif
}
}
}
}
#endif // BOOST_DETAIL_WINAPI_WAITABLE_TIMER_HPP

Some files were not shown because too many files have changed in this diff Show More