diff options
| -rw-r--r-- | coro.c | 16 | ||||
| -rw-r--r-- | coro.h | 3 | 
2 files changed, 11 insertions, 8 deletions
| @@ -81,13 +81,7 @@ coro_init (void)    coro_transfer ((coro_context *)new_coro, (coro_context *)create_coro); -#if HAVE_CFI -  asm (".cfi_startproc"); -#endif    func ((void *)arg); -#if HAVE_CFI -  asm (".cfi_endproc"); -#endif    /* the new coro returned. bad. just abort() for now */    abort (); @@ -102,7 +96,15 @@ static void  trampoline (int sig)  {    if (setjmp (((coro_context *)new_coro)->env)) -    coro_init (); /* start it */ +    { +#if HAVE_CFI +      asm (".cfi_startproc"); +#endif +      coro_init (); /* start it */ +#if HAVE_CFI +      asm (".cfi_endproc"); +#endif +    }    else      trampoline_count++;  } @@ -40,6 +40,7 @@   *            Reported by Michael_G_Schwern.   * 2006-11-26 Use _setjmp instead of setjmp on GNU/Linux.   * 2007-04-27 Set unwind frame info if gcc 3+ and ELF is detected. + *            Use _setjmp instead of setjmp on _XOPEN_SOURCE >= 600.   */  #ifndef CORO_H @@ -174,7 +175,7 @@ struct coro_context {    jmp_buf env;  }; -#if CORO_LINUX +#if CORO_LINUX || (_XOPEN_SOURCE >= 600)  # 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) | 
