2
0
mirror of https://github.com/boostorg/context.git synced 2026-02-01 08:22:17 +00:00

initial commit of boost.context

[SVN r76974]
This commit is contained in:
Oliver Kowalke
2012-02-11 13:04:55 +00:00
parent 88da98e37b
commit b8fd549bac
94 changed files with 43871 additions and 0 deletions

38
src/fcontext.cpp Normal file
View File

@@ -0,0 +1,38 @@
// Copyright Oliver Kowalke 2009.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#define BOOST_CONTEXT_SOURCE
#include <boost/context/fcontext.hpp>
#include <cstddef>
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
namespace boost {
namespace contexts {
extern "C" BOOST_CONTEXT_DECL void * BOOST_CONTEXT_CALLDECL boost_fcontext_align( void * vp)
{
void * base = vp;
if ( 0 != ( ( ( uintptr_t) base) & 15) )
base = ( char * )(
( ( ( ( uintptr_t) base) - 16) >> 4) << 4);
return base;
}
# if !defined(__arm__) && !defined(__powerpc__)
extern "C" BOOST_CONTEXT_DECL intptr_t BOOST_CONTEXT_CALLDECL boost_fcontext_start( boost_fcontext_t * ofc, boost_fcontext_t const* nfc)
{ return boost_fcontext_jump( ofc, nfc, 0); }
#endif
}}
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_SUFFIX
#endif