--- libcoro/coro.h 2008/11/08 04:31:28 1.33 +++ libcoro/coro.h 2008/11/08 13:42:28 1.35 @@ -230,13 +230,19 @@ # include struct coro_context { +#if _XOPEN_UNIX > 0 || CORO_LOSER jmp_buf env; +#else + sigjmp_buf env; +#endif }; # if _XOPEN_UNIX > 0 -# 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) +# elif CORO_LOSER +# 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 (!sigsetjmp ((p)->env, 0)) siglongjmp ((n)->env, 1); } while (0) # endif # define coro_destroy(ctx) (void *)(ctx) @@ -244,7 +250,7 @@ #elif CORO_ASM struct coro_context { - volatile void **sp; /* must be at offset 0 */ + void **sp; /* must be at offset 0 */ }; void __attribute__ ((__noinline__, __regparm__(2)))