]> git.sesse.net Git - casparcg/blob - dependencies64/boost/boost/coroutine/detail/trampoline.hpp
Add updates to the basic casparcg.config illustrating the possible options for use...
[casparcg] / dependencies64 / boost / boost / coroutine / detail / trampoline.hpp
1
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)
6
7 #ifndef BOOST_COROUTINES_DETAIL_TRAMPOLINE_H
8 #define BOOST_COROUTINES_DETAIL_TRAMPOLINE_H
9
10 #include <boost/assert.hpp>
11 #include <boost/config.hpp>
12 #include <boost/cstdint.hpp>
13
14 #include <boost/coroutine/detail/config.hpp>
15
16 #ifdef BOOST_HAS_ABI_HEADERS
17 #  include BOOST_ABI_PREFIX
18 #endif
19
20 namespace boost {
21 namespace coroutines {
22 namespace detail {
23
24 template< typename Coro >
25 void trampoline( intptr_t vp)
26 {
27     typedef typename Coro::param_type   param_type;
28
29     BOOST_ASSERT( 0 != vp);
30
31     param_type * param(
32         reinterpret_cast< param_type * >( vp) );
33     BOOST_ASSERT( 0 != param);
34     BOOST_ASSERT( 0 != param->data);
35
36     Coro * coro(
37         reinterpret_cast< Coro * >( param->coro) );
38     BOOST_ASSERT( 0 != coro);
39
40     coro->run( param->data);
41 }
42
43 template< typename Coro >
44 void trampoline_void( intptr_t vp)
45 {
46     typedef typename Coro::param_type   param_type;
47
48     BOOST_ASSERT( 0 != vp);
49
50     param_type * param(
51         reinterpret_cast< param_type * >( vp) );
52     BOOST_ASSERT( 0 != param);
53
54     Coro * coro(
55         reinterpret_cast< Coro * >( param->coro) );
56     BOOST_ASSERT( 0 != coro);
57     
58     coro->run();
59 }
60
61 }}}
62
63 #ifdef BOOST_HAS_ABI_HEADERS
64 #  include BOOST_ABI_SUFFIX
65 #endif
66
67 #endif // BOOST_COROUTINES_DETAIL_TRAMPOLINE_H