2 // Copyright Oliver Kowalke 2009.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
7 #ifndef BOOST_COROUTINES_DETAIL_TRAMPOLINE_PUSH_H
8 #define BOOST_COROUTINES_DETAIL_TRAMPOLINE_PUSH_H
12 #include <boost/assert.hpp>
13 #include <boost/config.hpp>
14 #include <boost/cstdint.hpp>
15 #include <boost/exception_ptr.hpp>
16 #include <boost/move/move.hpp>
18 #include <boost/coroutine/detail/config.hpp>
19 #include <boost/coroutine/detail/flags.hpp>
20 #include <boost/coroutine/detail/parameters.hpp>
21 #include <boost/coroutine/detail/setup.hpp>
22 #include <boost/coroutine/detail/setup.hpp>
23 #include <boost/coroutine/exceptions.hpp>
24 #include <boost/coroutine/flags.hpp>
26 #ifdef BOOST_HAS_ABI_HEADERS
27 # include BOOST_ABI_PREFIX
31 namespace coroutines {
34 template< typename Coro >
35 void trampoline_push( intptr_t vp)
37 typedef typename Coro::param_type param_type;
42 reinterpret_cast< param_type * >( vp) );
43 BOOST_ASSERT( 0 != param);
44 BOOST_ASSERT( 0 != param->data);
47 reinterpret_cast< Coro * >( param->coro) );
48 BOOST_ASSERT( 0 != coro);
50 coro->run( param->data);
53 template< typename Coro >
54 void trampoline_push_void( intptr_t vp)
56 typedef typename Coro::param_type param_type;
61 reinterpret_cast< param_type * >( vp) );
62 BOOST_ASSERT( 0 != param);
65 reinterpret_cast< Coro * >( param->coro) );
66 BOOST_ASSERT( 0 != coro);
73 #ifdef BOOST_HAS_ABI_HEADERS
74 # include BOOST_ABI_SUFFIX
77 #endif // BOOST_COROUTINES_DETAIL_TRAMPOLINE_PUSH_H