stabilize build system: depends, installer, boost/bdb fixes, cross targets groundwork
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
|
||||
// Copyright Oliver Kowalke 2014.
|
||||
// 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_CONTEXT_DETAIL_APPLY_H
|
||||
#define BOOST_CONTEXT_DETAIL_APPLY_H
|
||||
|
||||
#include <functional>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <boost/context/detail/config.hpp>
|
||||
#if defined(BOOST_NO_CXX17_STD_INVOKE)
|
||||
#include <boost/context/detail/invoke.hpp>
|
||||
#endif
|
||||
#include <boost/context/detail/index_sequence.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4100)
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace context {
|
||||
namespace detail {
|
||||
|
||||
template< typename Fn, typename Tpl, std::size_t ... I >
|
||||
auto
|
||||
apply_impl( Fn && fn, Tpl && tpl, index_sequence< I ... >)
|
||||
#if defined(BOOST_NO_CXX17_STD_INVOKE)
|
||||
-> decltype( invoke( std::forward< Fn >( fn), std::get< I >( std::forward< Tpl >( tpl) ) ... ) )
|
||||
#else
|
||||
-> decltype( std::invoke( std::forward< Fn >( fn), std::get< I >( std::forward< Tpl >( tpl) ) ... ) )
|
||||
#endif
|
||||
{
|
||||
#if defined(BOOST_NO_CXX17_STD_INVOKE)
|
||||
return invoke( std::forward< Fn >( fn), std::get< I >( std::forward< Tpl >( tpl) ) ... );
|
||||
#else
|
||||
return std::invoke( std::forward< Fn >( fn), std::get< I >( std::forward< Tpl >( tpl) ) ... );
|
||||
#endif
|
||||
}
|
||||
|
||||
template< typename Fn, typename Tpl >
|
||||
auto
|
||||
apply( Fn && fn, Tpl && tpl)
|
||||
-> decltype( apply_impl( std::forward< Fn >( fn),
|
||||
std::forward< Tpl >( tpl),
|
||||
make_index_sequence< std::tuple_size< typename std::decay< Tpl >::type >::value >{}) )
|
||||
{
|
||||
return apply_impl( std::forward< Fn >( fn),
|
||||
std::forward< Tpl >( tpl),
|
||||
make_index_sequence< std::tuple_size< typename std::decay< Tpl >::type >::value >{});
|
||||
}
|
||||
|
||||
}}}
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // BOOST_CONTEXT_DETAIL_APPLY_H
|
||||
@@ -0,0 +1,107 @@
|
||||
|
||||
// Copyright Oliver Kowalke 2014.
|
||||
// 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_CONTEXT_DETAIL_CONFIG_H
|
||||
#define BOOST_CONTEXT_DETAIL_CONFIG_H
|
||||
|
||||
// required for SD-6 compile-time integer sequences
|
||||
#include <utility>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#ifdef BOOST_CONTEXT_DECL
|
||||
# undef BOOST_CONTEXT_DECL
|
||||
#endif
|
||||
|
||||
#if (defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CONTEXT_DYN_LINK) ) && ! defined(BOOST_CONTEXT_STATIC_LINK)
|
||||
# if defined(BOOST_CONTEXT_SOURCE)
|
||||
# define BOOST_CONTEXT_DECL BOOST_SYMBOL_EXPORT
|
||||
# define BOOST_CONTEXT_BUILD_DLL
|
||||
# else
|
||||
# define BOOST_CONTEXT_DECL BOOST_SYMBOL_IMPORT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if ! defined(BOOST_CONTEXT_DECL)
|
||||
# define BOOST_CONTEXT_DECL
|
||||
#endif
|
||||
|
||||
#if ! defined(BOOST_CONTEXT_SOURCE) && ! defined(BOOST_ALL_NO_LIB) && ! defined(BOOST_CONTEXT_NO_LIB)
|
||||
# define BOOST_LIB_NAME boost_context
|
||||
# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CONTEXT_DYN_LINK)
|
||||
# define BOOST_DYN_LINK
|
||||
# endif
|
||||
# include <boost/config/auto_link.hpp>
|
||||
#endif
|
||||
|
||||
#undef BOOST_CONTEXT_CALLDECL
|
||||
#if (defined(i386) || defined(__i386__) || defined(__i386) \
|
||||
|| defined(__i486__) || defined(__i586__) || defined(__i686__) \
|
||||
|| defined(__X86__) || defined(_X86_) || defined(__THW_INTEL__) \
|
||||
|| defined(__I86__) || defined(__INTEL__) || defined(__IA32__) \
|
||||
|| defined(_M_IX86) || defined(_I86_)) && defined(BOOST_WINDOWS)
|
||||
# define BOOST_CONTEXT_CALLDECL __cdecl
|
||||
#else
|
||||
# define BOOST_CONTEXT_CALLDECL
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_USE_SEGMENTED_STACKS)
|
||||
# if ! ( (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) ) ) || \
|
||||
(defined(__clang__) && (__clang_major__ > 2 || ( __clang_major__ == 2 && __clang_minor__ > 3) ) ) )
|
||||
# error "compiler does not support segmented_stack stacks"
|
||||
# endif
|
||||
# define BOOST_CONTEXT_SEGMENTS 10
|
||||
#endif
|
||||
|
||||
|
||||
#define BOOST_CONTEXT_NO_CXX14_INTEGER_SEQUENCE
|
||||
// use rd6 macros for std::integer_sequence
|
||||
#if defined(__cpp_lib_integer_sequence) && __cpp_lib_integer_sequence >= 201304
|
||||
# undef BOOST_CONTEXT_NO_CXX14_INTEGER_SEQUENCE
|
||||
#endif
|
||||
// workaroud: MSVC 14 does not provide macros to test for compile-time integer sequence
|
||||
#if _MSC_VER > 1800 // _MSC_VER == 1800 -> MS Visual Studio 2013
|
||||
# undef BOOST_CONTEXT_NO_INDEX_SEQUENCE
|
||||
#endif
|
||||
// workaround: Xcode clang feature detection
|
||||
#if ! defined(__cpp_lib_integer_sequence) && __cpp_lib_integer_sequence >= 201304
|
||||
# if _LIBCPP_STD_VER > 11
|
||||
# undef BOOST_CONTEXT_NO_CXX14_INTEGER_SEQUENCE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// workaroud: MSVC 14 does support constexpr
|
||||
#if _MSC_VER > 1800 // _MSC_VER == 1800 -> MS Visual Studio 2013
|
||||
# undef BOOST_NO_CXX11_CONSTEXPR
|
||||
#endif
|
||||
|
||||
#undef BOOST_CONTEXT_NO_CXX11
|
||||
#if defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) || \
|
||||
defined(BOOST_NO_CXX11_CONSTEXPR) || \
|
||||
defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) || \
|
||||
defined(BOOST_NO_CXX11_FINAL) || \
|
||||
defined(BOOST_NO_CXX11_HDR_TUPLE) || \
|
||||
defined(BOOST_NO_CXX11_NOEXCEPT) || \
|
||||
defined(BOOST_NO_CXX11_NULLPTR) || \
|
||||
defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
|
||||
defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) || \
|
||||
defined(BOOST_NO_CXX11_UNIFIED_INITIALISATION_SYNTAX) || \
|
||||
defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || \
|
||||
defined(BOOST_NO_HDR_ATOMIC) || \
|
||||
defined(BOOST_NO_HDR_TUPLE)
|
||||
# define BOOST_CONTEXT_NO_CXX11
|
||||
#endif
|
||||
|
||||
#if ! defined(BOOST_EXECUTION_CONTEXT)
|
||||
# if defined(BOOST_USE_SEGMENTED_STACKS)
|
||||
# define BOOST_EXECUTION_CONTEXT 1
|
||||
# else
|
||||
# define BOOST_EXECUTION_CONTEXT 2
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif // BOOST_CONTEXT_DETAIL_CONFIG_H
|
||||
@@ -0,0 +1,40 @@
|
||||
|
||||
// Copyright Oliver Kowalke 2014.
|
||||
// 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_CONTEXT_DETAIL_DISABLE_OVERLOAD_H
|
||||
#define BOOST_CONTEXT_DETAIL_DISABLE_OVERLOAD_H
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <boost/context/detail/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace context {
|
||||
namespace detail {
|
||||
|
||||
// http://ericniebler.com/2013/08/07/universal-references-and-the-copy-constructo/
|
||||
template< typename X, typename Y >
|
||||
using disable_overload =
|
||||
typename std::enable_if<
|
||||
! std::is_base_of<
|
||||
X,
|
||||
typename std::decay< Y >::type
|
||||
>::value
|
||||
>::type;
|
||||
|
||||
}}}
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // BOOST_CONTEXT_DETAIL_DISABLE_OVERLOAD_H
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
// Copyright Oliver Kowalke 2014.
|
||||
// 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_CONTEXT_DETAIL_EXCEPTION_H
|
||||
#define BOOST_CONTEXT_DETAIL_EXCEPTION_H
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <boost/context/detail/fcontext.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace context {
|
||||
namespace detail {
|
||||
|
||||
struct forced_unwind {
|
||||
fcontext_t fctx;
|
||||
|
||||
forced_unwind( fcontext_t fctx_) :
|
||||
fctx( fctx_) {
|
||||
}
|
||||
};
|
||||
|
||||
}}}
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // BOOST_CONTEXT_DETAIL_EXCEPTION_H
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
// Copyright Oliver Kowalke 2014.
|
||||
// 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_CONTEXT_DETAIL_EXCHANGE_H
|
||||
#define BOOST_CONTEXT_DETAIL_EXCHANGE_H
|
||||
|
||||
#include <algorithm>
|
||||
#include <utility>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace context {
|
||||
namespace detail {
|
||||
|
||||
template< typename T, typename U = T >
|
||||
T exchange( T & t, U && nv) {
|
||||
T ov = std::move( t);
|
||||
t = std::forward< U >( nv);
|
||||
return ov;
|
||||
}
|
||||
|
||||
}}}
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // BOOST_CONTEXT_DETAIL_EXCHANGE_H
|
||||
@@ -0,0 +1,46 @@
|
||||
|
||||
// Copyright Oliver Kowalke 2009.
|
||||
// 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_CONTEXT_DETAIL_FCONTEXT_H
|
||||
#define BOOST_CONTEXT_DETAIL_FCONTEXT_H
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include <boost/context/detail/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace context {
|
||||
namespace detail {
|
||||
|
||||
typedef void* fcontext_t;
|
||||
|
||||
struct transfer_t {
|
||||
fcontext_t fctx;
|
||||
void * data;
|
||||
};
|
||||
|
||||
extern "C" BOOST_CONTEXT_DECL
|
||||
transfer_t BOOST_CONTEXT_CALLDECL jump_fcontext( fcontext_t const to, void * vp);
|
||||
extern "C" BOOST_CONTEXT_DECL
|
||||
fcontext_t BOOST_CONTEXT_CALLDECL make_fcontext( void * sp, std::size_t size, void (* fn)( transfer_t) );
|
||||
|
||||
// based on an idea of Giovanni Derreta
|
||||
extern "C" BOOST_CONTEXT_DECL
|
||||
transfer_t BOOST_CONTEXT_CALLDECL ontop_fcontext( fcontext_t const to, void * vp, transfer_t (* fn)( transfer_t) );
|
||||
|
||||
}}}
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // BOOST_CONTEXT_DETAIL_FCONTEXT_H
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
|
||||
// Copyright Oliver Kowalke 2009.
|
||||
// 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_CONTEXT_DETAIL_FCONTEXT_ARM_H
|
||||
#define BOOST_CONTEXT_DETAIL_FCONTEXT_ARM_H
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include <boost/context/detail/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace context {
|
||||
|
||||
extern "C" {
|
||||
|
||||
#define BOOST_CONTEXT_CALLDECL
|
||||
|
||||
struct stack_t
|
||||
{
|
||||
void * sp;
|
||||
std::size_t size;
|
||||
|
||||
stack_t() :
|
||||
sp( 0), size( 0)
|
||||
{}
|
||||
};
|
||||
|
||||
struct fp_t
|
||||
{
|
||||
boost::uint32_t fc_freg[16];
|
||||
|
||||
fp_t() :
|
||||
fc_freg()
|
||||
{}
|
||||
};
|
||||
|
||||
struct fcontext_t
|
||||
{
|
||||
boost::uint32_t fc_greg[11];
|
||||
stack_t fc_stack;
|
||||
fp_t fc_fp;
|
||||
|
||||
fcontext_t() :
|
||||
fc_greg(),
|
||||
fc_stack(),
|
||||
fc_fp()
|
||||
{}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // BOOST_CONTEXT_DETAIL_FCONTEXT_ARM_H
|
||||
@@ -0,0 +1,70 @@
|
||||
|
||||
// Copyright Oliver Kowalke 2009.
|
||||
// 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_CONTEXT_DETAIL_FCONTEXT_ARM_MAC_H
|
||||
#define BOOST_CONTEXT_DETAIL_FCONTEXT_ARM_MAC_H
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include <boost/context/detail/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace context {
|
||||
|
||||
extern "C" {
|
||||
|
||||
#define BOOST_CONTEXT_CALLDECL
|
||||
|
||||
struct stack_t
|
||||
{
|
||||
void * sp;
|
||||
std::size_t size;
|
||||
|
||||
stack_t() :
|
||||
sp( 0), size( 0)
|
||||
{}
|
||||
};
|
||||
|
||||
struct fp_t
|
||||
{
|
||||
boost::uint32_t fc_freg[16];
|
||||
|
||||
fp_t() :
|
||||
fc_freg()
|
||||
{}
|
||||
};
|
||||
|
||||
struct fcontext_t
|
||||
{
|
||||
boost::uint32_t fc_greg[11];
|
||||
stack_t fc_stack;
|
||||
fp_t fc_fp;
|
||||
void * fc_unwind_sjlj;
|
||||
|
||||
fcontext_t() :
|
||||
fc_greg(),
|
||||
fc_stack(),
|
||||
fc_fp(),
|
||||
fc_unwind_sjlj( 0)
|
||||
{}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // BOOST_CONTEXT_DETAIL_FCONTEXT_ARM_MAC_H
|
||||
@@ -0,0 +1,71 @@
|
||||
|
||||
// Copyright Oliver Kowalke 2009.
|
||||
// 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_CONTEXT_DETAIL_FCONTEXT_ARM_WIN_H
|
||||
#define BOOST_CONTEXT_DETAIL_FCONTEXT_ARM_WIN_H
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include <boost/context/detail/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace context {
|
||||
|
||||
extern "C" {
|
||||
|
||||
#define BOOST_CONTEXT_CALLDECL
|
||||
|
||||
struct stack_t
|
||||
{
|
||||
void * sp;
|
||||
std::size_t size;
|
||||
void * limit;
|
||||
|
||||
stack_t() :
|
||||
sp( 0), size( 0), limit( 0)
|
||||
{}
|
||||
};
|
||||
|
||||
struct fp_t
|
||||
{
|
||||
boost::uint32_t fc_freg[16];
|
||||
|
||||
fp_t() :
|
||||
fc_freg()
|
||||
{}
|
||||
};
|
||||
|
||||
struct fcontext_t
|
||||
{
|
||||
boost::uint32_t fc_greg[11];
|
||||
stack_t fc_stack;
|
||||
fp_t fc_fp;
|
||||
boost::uint32_t fc_dealloc;
|
||||
|
||||
fcontext_t() :
|
||||
fc_greg(),
|
||||
fc_stack(),
|
||||
fc_fp(),
|
||||
fc_dealloc( 0)
|
||||
{}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // BOOST_CONTEXT_DETAIL_FCONTEXT_ARM_WIN_H
|
||||
@@ -0,0 +1,59 @@
|
||||
|
||||
// Copyright Oliver Kowalke 2009.
|
||||
// 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_CONTEXT_DETAIL_FCONTEXT_I386H
|
||||
#define BOOST_CONTEXT_DETAIL_FCONTEXT_I386H
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include <boost/context/detail/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace context {
|
||||
|
||||
extern "C" {
|
||||
|
||||
#define BOOST_CONTEXT_CALLDECL __attribute__((cdecl))
|
||||
|
||||
struct stack_t
|
||||
{
|
||||
void * sp;
|
||||
std::size_t size;
|
||||
|
||||
stack_t() :
|
||||
sp( 0), size( 0)
|
||||
{}
|
||||
};
|
||||
|
||||
struct fcontext_t
|
||||
{
|
||||
boost::uint32_t fc_greg[6];
|
||||
stack_t fc_stack;
|
||||
boost::uint32_t fc_freg[2];
|
||||
|
||||
fcontext_t() :
|
||||
fc_greg(),
|
||||
fc_stack(),
|
||||
fc_freg()
|
||||
{}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // BOOST_CONTEXT_DETAIL_FCONTEXT_I386_H
|
||||
@@ -0,0 +1,88 @@
|
||||
|
||||
// Copyright Oliver Kowalke 2009.
|
||||
// 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_CONTEXT_DETAIL_FCONTEXT_I386H
|
||||
#define BOOST_CONTEXT_DETAIL_FCONTEXT_I386H
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include <boost/context/detail/config.hpp>
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4351)
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace context {
|
||||
|
||||
extern "C" {
|
||||
|
||||
#define BOOST_CONTEXT_CALLDECL __cdecl
|
||||
|
||||
struct stack_t
|
||||
{
|
||||
void * sp;
|
||||
std::size_t size;
|
||||
void * limit;
|
||||
|
||||
stack_t() :
|
||||
sp( 0), size( 0), limit( 0)
|
||||
{}
|
||||
};
|
||||
|
||||
struct fp_t
|
||||
{
|
||||
boost::uint32_t fc_freg[2];
|
||||
|
||||
fp_t() :
|
||||
fc_freg()
|
||||
{}
|
||||
};
|
||||
|
||||
struct fcontext_t
|
||||
{
|
||||
boost::uint32_t fc_greg[6];
|
||||
stack_t fc_stack;
|
||||
void * fc_excpt_lst;
|
||||
void * fc_local_storage;
|
||||
fp_t fc_fp;
|
||||
boost::uint32_t fc_dealloc;
|
||||
|
||||
fcontext_t() :
|
||||
fc_greg(),
|
||||
fc_stack(),
|
||||
fc_excpt_lst( 0),
|
||||
fc_local_storage( 0),
|
||||
fc_fp(),
|
||||
fc_dealloc( 0)
|
||||
{}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_CONTEXT_DETAIL_FCONTEXT_I386_H
|
||||
@@ -0,0 +1,70 @@
|
||||
|
||||
// Copyright Oliver Kowalke 2009.
|
||||
// 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_CONTEXT_DETAIL_FCONTEXT_MIPS_H
|
||||
#define BOOST_CONTEXT_DETAIL_FCONTEXT_MIPS_H
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include <boost/context/detail/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace context {
|
||||
|
||||
extern "C" {
|
||||
|
||||
#define BOOST_CONTEXT_CALLDECL
|
||||
|
||||
// on MIPS we assume 64bit regsiters - even for 32bit ABIs
|
||||
|
||||
struct stack_t
|
||||
{
|
||||
void * sp;
|
||||
std::size_t size;
|
||||
|
||||
stack_t() :
|
||||
sp( 0), size( 0)
|
||||
{}
|
||||
};
|
||||
|
||||
struct fp_t
|
||||
{
|
||||
boost::uint64_t fc_freg[6];
|
||||
|
||||
fp_t() :
|
||||
fc_freg()
|
||||
{}
|
||||
};
|
||||
|
||||
struct fcontext_t
|
||||
{
|
||||
boost::uint32_t fc_greg[12];
|
||||
stack_t fc_stack;
|
||||
fp_t fc_fp;
|
||||
|
||||
fcontext_t() :
|
||||
fc_greg(),
|
||||
fc_stack(),
|
||||
fc_fp()
|
||||
{}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // BOOST_CONTEXT_DETAIL_FCONTEXT_MIPS_H
|
||||
@@ -0,0 +1,72 @@
|
||||
|
||||
// Copyright Oliver Kowalke 2009.
|
||||
// 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_CONTEXT_DETAIL_FCONTEXT_PPC_H
|
||||
#define BOOST_CONTEXT_DETAIL_FCONTEXT_PPC_H
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include <boost/context/detail/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace context {
|
||||
|
||||
extern "C" {
|
||||
|
||||
#define BOOST_CONTEXT_CALLDECL
|
||||
|
||||
struct stack_t
|
||||
{
|
||||
void * sp;
|
||||
std::size_t size;
|
||||
|
||||
stack_t() :
|
||||
sp( 0), size( 0)
|
||||
{}
|
||||
};
|
||||
|
||||
struct fp_t
|
||||
{
|
||||
boost::uint64_t fc_freg[19];
|
||||
|
||||
fp_t() :
|
||||
fc_freg()
|
||||
{}
|
||||
};
|
||||
|
||||
struct fcontext_t
|
||||
{
|
||||
# if defined(__powerpc64__)
|
||||
boost::uint64_t fc_greg[23];
|
||||
# else
|
||||
boost::uint32_t fc_greg[23];
|
||||
# endif
|
||||
stack_t fc_stack;
|
||||
fp_t fc_fp;
|
||||
|
||||
fcontext_t() :
|
||||
fc_greg(),
|
||||
fc_stack(),
|
||||
fc_fp()
|
||||
{}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // BOOST_CONTEXT_DETAIL_FCONTEXT_PPC_H
|
||||
@@ -0,0 +1,90 @@
|
||||
// Copyright Martin Husemann 2012
|
||||
// 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_CTX_DETAIL_FCONTEXT_SPARC_H
|
||||
#define BOOST_CTX_DETAIL_FCONTEXT_SPARC_H
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include <boost/context/detail/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace context {
|
||||
|
||||
extern "C" {
|
||||
|
||||
#define BOOST_CONTEXT_CALLDECL
|
||||
|
||||
// if defined(_LP64) we are compiling for sparc64, otherwise it is 32 bit
|
||||
// sparc.
|
||||
|
||||
|
||||
struct stack_t
|
||||
{
|
||||
void * sp;
|
||||
std::size_t size;
|
||||
|
||||
stack_t() :
|
||||
sp( 0), size( 0)
|
||||
{}
|
||||
};
|
||||
|
||||
struct fp_t
|
||||
{
|
||||
#ifdef _LP64
|
||||
boost::uint64_t fp_freg[32];
|
||||
boost::uint64_t fp_fprs, fp_fsr;
|
||||
#else
|
||||
boost::uint64_t fp_freg[16];
|
||||
boost::uint32_t fp_fsr;
|
||||
#endif
|
||||
|
||||
fp_t() :
|
||||
fp_freg(),
|
||||
#ifdef _LP64
|
||||
fp_fprs(),
|
||||
#endif
|
||||
fp_fsr()
|
||||
{}
|
||||
}
|
||||
#ifdef _LP64
|
||||
__attribute__((__aligned__(64))) // allow VIS instructions to be used
|
||||
#endif
|
||||
;
|
||||
|
||||
struct fcontext_t
|
||||
{
|
||||
fp_t fc_fp; // fpu stuff first, for easier alignement
|
||||
#ifdef _LP64
|
||||
boost::uint64_t
|
||||
#else
|
||||
boost::uint32_t
|
||||
#endif
|
||||
fc_greg[8];
|
||||
stack_t fc_stack;
|
||||
|
||||
fcontext_t() :
|
||||
fc_fp(),
|
||||
fc_greg(),
|
||||
fc_stack()
|
||||
{}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // BOOST_CTX_DETAIL_FCONTEXT_SPARC_H
|
||||
@@ -0,0 +1,68 @@
|
||||
|
||||
// Copyright Oliver Kowalke 2009.
|
||||
// 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_CONTEXT_DETAIL_FCONTEXT_X86_64_H
|
||||
#define BOOST_CONTEXT_DETAIL_FCONTEXT_X86_64_H
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include <boost/context/detail/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace context {
|
||||
|
||||
extern "C" {
|
||||
|
||||
#define BOOST_CONTEXT_CALLDECL
|
||||
|
||||
struct stack_t
|
||||
{
|
||||
void * sp;
|
||||
std::size_t size;
|
||||
|
||||
stack_t() :
|
||||
sp( 0), size( 0)
|
||||
{}
|
||||
};
|
||||
|
||||
struct fp_t
|
||||
{
|
||||
boost::uint32_t fc_freg[2];
|
||||
|
||||
fp_t() :
|
||||
fc_freg()
|
||||
{}
|
||||
};
|
||||
|
||||
struct fcontext_t
|
||||
{
|
||||
boost::uint64_t fc_greg[8];
|
||||
stack_t fc_stack;
|
||||
fp_t fc_fp;
|
||||
|
||||
fcontext_t() :
|
||||
fc_greg(),
|
||||
fc_stack(),
|
||||
fc_fp()
|
||||
{}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // BOOST_CONTEXT_DETAIL_FCONTEXT_X86_64_H
|
||||
@@ -0,0 +1,77 @@
|
||||
|
||||
// Copyright Oliver Kowalke 2009.
|
||||
// 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_CONTEXT_DETAIL_FCONTEXT_X86_64_H
|
||||
#define BOOST_CONTEXT_DETAIL_FCONTEXT_X86_64_H
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include <boost/context/detail/config.hpp>
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4351)
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace context {
|
||||
|
||||
extern "C" {
|
||||
|
||||
#define BOOST_CONTEXT_CALLDECL
|
||||
|
||||
struct stack_t
|
||||
{
|
||||
void * sp;
|
||||
std::size_t size;
|
||||
void * limit;
|
||||
|
||||
stack_t() :
|
||||
sp( 0), size( 0), limit( 0)
|
||||
{}
|
||||
};
|
||||
|
||||
struct fcontext_t
|
||||
{
|
||||
boost::uint64_t fc_greg[10];
|
||||
stack_t fc_stack;
|
||||
void * fc_local_storage;
|
||||
boost::uint64_t fc_fp[24];
|
||||
boost::uint64_t fc_dealloc;
|
||||
|
||||
fcontext_t() :
|
||||
fc_greg(),
|
||||
fc_stack(),
|
||||
fc_local_storage( 0),
|
||||
fc_fp(),
|
||||
fc_dealloc()
|
||||
{}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_CONTEXT_DETAIL_FCONTEXT_X86_64_H
|
||||
@@ -0,0 +1,72 @@
|
||||
|
||||
// Copyright Oliver Kowalke 2014.
|
||||
// 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_CONTEXT_DETAIL_INDEX_SEQUENCE_H
|
||||
#define BOOST_CONTEXT_DETAIL_INDEX_SEQUENCE_H
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <boost/context/detail/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace context {
|
||||
namespace detail {
|
||||
|
||||
#if ! defined(BOOST_CONTEXT_NO_CXX14_INTEGER_SEQUENCE)
|
||||
template< std::size_t ... I >
|
||||
using index_sequence = std::index_sequence< I ... >;
|
||||
template< std::size_t I >
|
||||
using make_index_sequence = std::make_index_sequence< I >;
|
||||
template< typename ... T >
|
||||
using index_sequence_for = std::index_sequence_for< T ... >;
|
||||
#else
|
||||
//http://stackoverflow.com/questions/17424477/implementation-c14-make-integer-sequence
|
||||
|
||||
template< std::size_t ... I >
|
||||
struct index_sequence {
|
||||
using type = index_sequence;
|
||||
using value_type = std::size_t;
|
||||
static constexpr std::size_t size() {
|
||||
return sizeof ... (I);
|
||||
}
|
||||
};
|
||||
|
||||
template< typename Seq1, typename Seq2 >
|
||||
struct concat_sequence;
|
||||
|
||||
template< std::size_t ... I1, std::size_t ... I2 >
|
||||
struct concat_sequence< index_sequence< I1 ... >, index_sequence< I2 ... > > : public index_sequence< I1 ..., (sizeof ... (I1)+I2) ... > {
|
||||
};
|
||||
|
||||
template< std::size_t I >
|
||||
struct make_index_sequence : public concat_sequence< typename make_index_sequence< I/2 >::type,
|
||||
typename make_index_sequence< I-I/2 >::type > {
|
||||
};
|
||||
|
||||
template<>
|
||||
struct make_index_sequence< 0 > : public index_sequence<> {
|
||||
};
|
||||
template<>
|
||||
struct make_index_sequence< 1 > : public index_sequence< 0 > {
|
||||
};
|
||||
|
||||
template< typename ... T >
|
||||
using index_sequence_for = make_index_sequence< sizeof ... (T) >;
|
||||
#endif
|
||||
|
||||
}}}
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // BOOST_CONTEXT_DETAIL_INDEX_SEQUENCE_H
|
||||
@@ -0,0 +1,50 @@
|
||||
|
||||
// Copyright Oliver Kowalke 2014.
|
||||
// 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_CONTEXT_DETAIL_INVOKE_H
|
||||
#define BOOST_CONTEXT_DETAIL_INVOKE_H
|
||||
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <boost/context/detail/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace context {
|
||||
namespace detail {
|
||||
|
||||
template< typename Fn, typename ... Args >
|
||||
typename std::enable_if<
|
||||
std::is_member_pointer< typename std::decay< Fn >::type >::value,
|
||||
typename std::result_of< Fn &&( Args && ... ) >::type
|
||||
>::type
|
||||
invoke( Fn && fn, Args && ... args) {
|
||||
return std::mem_fn( fn)( std::forward< Args >( args) ... );
|
||||
}
|
||||
|
||||
template< typename Fn, typename ... Args >
|
||||
typename std::enable_if<
|
||||
! std::is_member_pointer< typename std::decay< Fn >::type >::value,
|
||||
typename std::result_of< Fn &&( Args && ... ) >::type
|
||||
>::type
|
||||
invoke( Fn && fn, Args && ... args) {
|
||||
return std::forward< Fn >( fn)( std::forward< Args >( args) ... );
|
||||
}
|
||||
|
||||
}}}
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // BOOST_CONTEXT_DETAIL_INVOKE_H
|
||||
@@ -0,0 +1,129 @@
|
||||
|
||||
// Copyright Oliver Kowalke 2014.
|
||||
// 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_CONTEXT_DETAIL_TUPLE_H
|
||||
#define BOOST_CONTEXT_DETAIL_TUPLE_H
|
||||
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <boost/context/detail/config.hpp>
|
||||
#include <boost/context/detail/index_sequence.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace context {
|
||||
namespace detail {
|
||||
|
||||
template< typename ... S, typename ... T, std::size_t ... I >
|
||||
void
|
||||
head_impl( std::tuple< S ... > & s,
|
||||
std::tuple< T ... > & t, index_sequence< I ... >) {
|
||||
t = std::tuple< T ... >{ std::get< I >( s) ... };
|
||||
}
|
||||
|
||||
template< typename ... S, typename ... T, std::size_t ... I >
|
||||
void
|
||||
head_impl( std::tuple< S ... > && s,
|
||||
std::tuple< T ... > & t, index_sequence< I ... >) {
|
||||
t = std::tuple< T ... >{ std::get< I >( std::move( s) ) ... };
|
||||
}
|
||||
|
||||
template< typename ... S, std::size_t ... I1, typename ... T, std::size_t ... I2 >
|
||||
void
|
||||
tail_impl( std::tuple< S ... > & s, index_sequence< I1 ... >,
|
||||
std::tuple< T ... > & t, index_sequence< I2 ... >) {
|
||||
constexpr std::size_t Idx = (sizeof...(I1)) - (sizeof...(I2));
|
||||
t = std::tuple< T ... >{ std::get< (Idx + I2) >( s) ... };
|
||||
}
|
||||
|
||||
template< typename ... S, std::size_t ... I1, typename ... T, std::size_t ... I2 >
|
||||
void
|
||||
tail_impl( std::tuple< S ... > && s, index_sequence< I1 ... >,
|
||||
std::tuple< T ... > & t, index_sequence< I2 ... >) {
|
||||
constexpr std::size_t Idx = (sizeof...(I1)) - (sizeof...(I2));
|
||||
t = std::tuple< T ... >{ std::get< (Idx + I2) >( std::move( s) ) ... };
|
||||
}
|
||||
|
||||
template< typename ... T >
|
||||
class tuple_head;
|
||||
|
||||
template< typename ... T >
|
||||
class tuple_head< std::tuple< T ... > > {
|
||||
private:
|
||||
std::tuple< T ... > & t_;
|
||||
|
||||
public:
|
||||
tuple_head( std::tuple< T ... > & t) noexcept :
|
||||
t_( t) {
|
||||
}
|
||||
|
||||
template< typename ... S >
|
||||
void operator=( std::tuple< S ... > & s) {
|
||||
static_assert((sizeof...(T)) <= (sizeof...(S)), "invalid tuple size");
|
||||
head_impl( s,
|
||||
t_, index_sequence_for< T ... >{} );
|
||||
}
|
||||
template< typename ... S >
|
||||
void operator=( std::tuple< S ... > && s) {
|
||||
static_assert((sizeof...(T)) <= (sizeof...(S)), "invalid tuple size");
|
||||
head_impl( std::move( s),
|
||||
t_, index_sequence_for< T ... >{} );
|
||||
}
|
||||
};
|
||||
|
||||
template< typename ... T >
|
||||
class tuple_tail;
|
||||
|
||||
template< typename ... T >
|
||||
class tuple_tail< std::tuple< T ... > > {
|
||||
private:
|
||||
std::tuple< T ... > & t_;
|
||||
|
||||
public:
|
||||
tuple_tail( std::tuple< T ... > & t) noexcept :
|
||||
t_( t) {
|
||||
}
|
||||
|
||||
template< typename ... S >
|
||||
void operator=( std::tuple< S ... > & s) {
|
||||
static_assert((sizeof...(T)) <= (sizeof...(S)), "invalid tuple size");
|
||||
tail_impl( s, index_sequence_for< S ... >{},
|
||||
t_, index_sequence_for< T ... >{} );
|
||||
}
|
||||
|
||||
template< typename ... S >
|
||||
void operator=( std::tuple< S ... > && s) {
|
||||
static_assert((sizeof...(T)) <= (sizeof...(S)), "invalid tuple size");
|
||||
tail_impl( std::move( s), index_sequence_for< S ... >{},
|
||||
t_, index_sequence_for< T ... >{} );
|
||||
}
|
||||
};
|
||||
|
||||
template< typename ... T >
|
||||
detail::tuple_head< std::tuple< T ... > >
|
||||
head( std::tuple< T ... > & tpl) {
|
||||
return tuple_head< std::tuple< T ... > >{ tpl };
|
||||
}
|
||||
|
||||
template< typename ... T >
|
||||
detail::tuple_tail< std::tuple< T ... > >
|
||||
tail( std::tuple< T ... > & tpl) {
|
||||
return tuple_tail< std::tuple< T ... > >{ tpl };
|
||||
}
|
||||
|
||||
}}}
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // BOOST_CONTEXT_DETAIL_TUPLE_H
|
||||
Reference in New Issue
Block a user