fcontext.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. extern "C" BOOST_CONTEXT_DECL
  22. transfer_t BOOST_CONTEXT_CALLDECL jump_fcontext( fcontext_t const to, void * vp);
  23. extern "C" BOOST_CONTEXT_DECL
  24. fcontext_t BOOST_CONTEXT_CALLDECL make_fcontext( void * sp, std::size_t size, void (* fn)( transfer_t) );
  25. // based on an idea of Giovanni Derreta
  26. extern "C" BOOST_CONTEXT_DECL
  27. transfer_t BOOST_CONTEXT_CALLDECL ontop_fcontext( fcontext_t const to, void * vp, transfer_t (* fn)( transfer_t) );
  28. }}}
  29. #ifdef BOOST_HAS_ABI_HEADERS
  30. # include BOOST_ABI_SUFFIX
  31. #endif
  32. #endif // BOOST_CONTEXT_DETAIL_FCONTEXT_H