Chris@16: Chris@16: // Copyright Oliver Kowalke 2009. Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef BOOST_COROUTINES_DETAIL_TRAMPOLINE_H Chris@16: #define BOOST_COROUTINES_DETAIL_TRAMPOLINE_H Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@101: Chris@101: #include Chris@16: Chris@16: #ifdef BOOST_HAS_ABI_HEADERS Chris@16: # include BOOST_ABI_PREFIX Chris@16: #endif Chris@16: Chris@16: namespace boost { Chris@16: namespace coroutines { Chris@16: namespace detail { Chris@16: Chris@101: template< typename Coro > Chris@101: void trampoline( intptr_t vp) Chris@16: { Chris@101: typedef typename Coro::param_type param_type; Chris@16: Chris@101: BOOST_ASSERT( 0 != vp); Chris@101: Chris@101: param_type * param( Chris@101: reinterpret_cast< param_type * >( vp) ); Chris@101: BOOST_ASSERT( 0 != param); Chris@101: BOOST_ASSERT( 0 != param->data); Chris@101: Chris@101: Coro * coro( Chris@101: reinterpret_cast< Coro * >( param->coro) ); Chris@101: BOOST_ASSERT( 0 != coro); Chris@101: Chris@101: coro->run( param->data); Chris@16: } Chris@16: Chris@101: template< typename Coro > Chris@101: void trampoline_void( intptr_t vp) Chris@16: { Chris@101: typedef typename Coro::param_type param_type; Chris@16: Chris@101: BOOST_ASSERT( 0 != vp); Chris@16: Chris@101: param_type * param( Chris@101: reinterpret_cast< param_type * >( vp) ); Chris@101: BOOST_ASSERT( 0 != param); Chris@101: Chris@101: Coro * coro( Chris@101: reinterpret_cast< Coro * >( param->coro) ); Chris@101: BOOST_ASSERT( 0 != coro); Chris@101: Chris@101: coro->run(); Chris@16: } Chris@16: Chris@16: }}} Chris@16: Chris@16: #ifdef BOOST_HAS_ABI_HEADERS Chris@16: # include BOOST_ABI_SUFFIX Chris@16: #endif Chris@16: Chris@16: #endif // BOOST_COROUTINES_DETAIL_TRAMPOLINE_H