ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libcoro/coro.h
(Generate patch)

Comparing libcoro/coro.h (file contents):
Revision 1.33 by root, Sat Nov 8 04:31:28 2008 UTC vs.
Revision 1.35 by root, Sat Nov 8 13:42:28 2008 UTC

228# endif 228# endif
229 229
230# include <setjmp.h> 230# include <setjmp.h>
231 231
232struct coro_context { 232struct coro_context {
233#if _XOPEN_UNIX > 0 || CORO_LOSER
233 jmp_buf env; 234 jmp_buf env;
235#else
236 sigjmp_buf env;
237#endif
234}; 238};
235 239
236# if _XOPEN_UNIX > 0 240# if _XOPEN_UNIX > 0
237# define coro_transfer(p,n) do { if (!_setjmp ((p)->env)) _longjmp ((n)->env, 1); } while (0) 241# define coro_transfer(p,n) do { if (! _setjmp ((p)->env )) _longjmp ((n)->env, 1); } while (0)
242# elif CORO_LOSER
243# define coro_transfer(p,n) do { if (! setjmp ((p)->env )) longjmp ((n)->env, 1); } while (0)
238# else 244# else
239# define coro_transfer(p,n) do { if (! setjmp ((p)->env)) longjmp ((n)->env, 1); } while (0) 245# define coro_transfer(p,n) do { if (!sigsetjmp ((p)->env, 0)) siglongjmp ((n)->env, 1); } while (0)
240# endif 246# endif
241 247
242# define coro_destroy(ctx) (void *)(ctx) 248# define coro_destroy(ctx) (void *)(ctx)
243 249
244#elif CORO_ASM 250#elif CORO_ASM
245 251
246struct coro_context { 252struct coro_context {
247 volatile void **sp; /* must be at offset 0 */ 253 void **sp; /* must be at offset 0 */
248}; 254};
249 255
250void __attribute__ ((__noinline__, __regparm__(2))) 256void __attribute__ ((__noinline__, __regparm__(2)))
251coro_transfer (coro_context *prev, coro_context *next); 257coro_transfer (coro_context *prev, coro_context *next);
252 258

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines