2019-06-24 14:54:19 +03:00
|
|
|
/*
|
|
|
|
* This file is part of the "Coroutine" project and released under the MIT License.
|
|
|
|
*
|
|
|
|
* Created by Samuel Williams on 24/6/2019.
|
2019-12-28 02:41:47 +03:00
|
|
|
* Copyright, 2019, by Samuel Williams.
|
2019-06-24 14:54:19 +03:00
|
|
|
*/
|
|
|
|
|
2019-12-05 16:24:58 +03:00
|
|
|
/* According to Solaris' ucontext.h, makecontext, etc. are removed in SUSv4.
|
|
|
|
* To enable the prototype declarations, we need to define __EXTENSIONS__.
|
|
|
|
*/
|
|
|
|
#if defined(__sun) && !defined(__EXTENSIONS__)
|
|
|
|
#define __EXTENSIONS__
|
|
|
|
#endif
|
2019-06-24 14:54:19 +03:00
|
|
|
#include "Context.h"
|
|
|
|
|
|
|
|
void coroutine_trampoline(void * _start, void * _context)
|
|
|
|
{
|
2020-01-31 09:53:03 +03:00
|
|
|
coroutine_start start = (coroutine_start)_start;
|
2019-06-24 14:54:19 +03:00
|
|
|
struct coroutine_context * context = _context;
|
|
|
|
|
|
|
|
start(context->from, context);
|
|
|
|
}
|