From 930f681be412f20ef67d9aa0d40ae44cbf682814 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 8 Nov 2008 04:31:28 +0000 Subject: *** empty log message *** --- coro.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'coro.h') diff --git a/coro.h b/coro.h index 2a907b0..45c8e92 100644 --- a/coro.h +++ b/coro.h @@ -62,6 +62,9 @@ * introduce coro_destroy, which is a nop except for pthreads. * speed up CORO_PTHREAD. Do no longer leak threads either. * coro_create now allows one to create source coro_contexts. + * do not rely on makecontext passing a void * correctly. + * try harder to get _setjmp/_longjmp. + * major code cleanup/restructuring. */ #ifndef CORO_H @@ -220,16 +223,20 @@ struct coro_context { # define _GNU_SOURCE /* for linux libc */ # endif +# if !CORO_LOSER +# include +# endif + # include struct coro_context { jmp_buf env; }; -# if CORO_LINUX || (_XOPEN_SOURCE >= 600) +# if _XOPEN_UNIX > 0 # define coro_transfer(p,n) do { if (!_setjmp ((p)->env)) _longjmp ((n)->env, 1); } while (0) # else -# define coro_transfer(p,n) do { if (!setjmp ((p)->env)) longjmp ((n)->env, 1); } while (0) +# define coro_transfer(p,n) do { if (! setjmp ((p)->env)) longjmp ((n)->env, 1); } while (0) # endif # define coro_destroy(ctx) (void *)(ctx) -- cgit v1.2.3