fcontext.hpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright Oliver Kowalke 2009.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef BOOST_CONTEXT_DETAIL_FCONTEXT_H
  6. #define BOOST_CONTEXT_DETAIL_FCONTEXT_H
  7. #include <boost/config.hpp>
  8. #include <boost/cstdint.hpp>
  9. #include <boost/context/detail/config.hpp>
  10. #ifdef BOOST_HAS_ABI_HEADERS
  11. # include BOOST_ABI_PREFIX
  12. #endif
  13. namespace boost {
  14. namespace context {
  15. namespace detail {
  16. typedef void* fcontext_t;
  17. struct transfer_t {
  18. fcontext_t fctx;
  19. void * data;
  20. };
  21. BOOST_CONTEXT_DECL transfer_t jump_fcontext( fcontext_t const to, void * vp);
  22. BOOST_CONTEXT_DECL fcontext_t make_fcontext( void * sp, std::size_t size, void (* fn)( transfer_t) );
  23. // based on an idea of Giovanni Derreta
  24. BOOST_CONTEXT_DECL transfer_t ontop_fcontext( fcontext_t const to, void * vp, transfer_t (* fn)( transfer_t) );
  25. }}}
  26. #ifdef BOOST_HAS_ABI_HEADERS
  27. # include BOOST_ABI_SUFFIX
  28. #endif
  29. #endif // BOOST_CONTEXT_DETAIL_FCONTEXT_H