--- libcoro/coro.h 2008/11/08 04:52:01 1.34 +++ libcoro/coro.h 2008/11/14 05:27:08 1.38 @@ -65,6 +65,7 @@ * do not rely on makecontext passing a void * correctly. * try harder to get _setjmp/_longjmp. * major code cleanup/restructuring. + * 2008-11-10 the .cfi hacks are no longer needed. */ #ifndef CORO_H @@ -148,7 +149,7 @@ * Allocating/deallocating the stack is your own responsibility. * * As a special case, if coro, arg, sptr and ssize are all zero, - * then an "empty" coro_contetx will be created that is suitable + * then an "empty" coro_context will be created that is suitable * as an initial source for coro_transfer. * * This function is not reentrant, but putting a mutex around it @@ -173,7 +174,9 @@ /* * The following prototype defines the coroutine destroy function. It is * usually implemented as a macro, so watch out. It also serves - * no purpose unless you want to use the CORO_PTHREAD backend. + * no purpose unless you want to use the CORO_PTHREAD backend, + * where it is used to clean up the thread. You are responsible + * for freeing the stack and the context itself. * * This function is thread-safe and reentrant. */ @@ -227,10 +230,20 @@ # include # endif +/* solaris is hopelessly borked, it expands _XOPEN_UNIX to nothing */ +# if __sun +# undef _XOPEN_UNIX +# define _XOPEN_UNIX 1 +# endif + # include struct coro_context { +#if _XOPEN_UNIX > 0 || CORO_LOSER jmp_buf env; +#else + sigjmp_buf env; +#endif }; # if _XOPEN_UNIX > 0