2019-06-24 07:54:19 -04: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-27 18:41:47 -05:00
|
|
|
* Copyright, 2019, by Samuel Williams.
|
2019-06-24 07:54:19 -04:00
|
|
|
*/
|
|
|
|
|
2019-12-05 08:24:58 -05: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
|
2021-06-25 18:17:26 -04:00
|
|
|
|
2019-06-24 07:54:19 -04:00
|
|
|
#include "Context.h"
|
|
|
|
|
|
|
|
void coroutine_trampoline(void * _start, void * _context)
|
|
|
|
{
|
2020-01-31 01:53:03 -05:00
|
|
|
coroutine_start start = (coroutine_start)_start;
|
2019-06-24 07:54:19 -04:00
|
|
|
struct coroutine_context * context = _context;
|
|
|
|
|
|
|
|
start(context->from, context);
|
|
|
|
}
|