rc

[fork] interactive rc shell
git clone https://hhvn.uk/rc
git clone git://hhvn.uk/rc
Log | Files | Refs | README | LICENSE

jbwrap.h (675B)


      1 #include <setjmp.h>
      2 
      3 /* If we have POSIX sigjmp_buf and friends, use them.  If we don't, just
      4 use a jmp_buf.  This probably fails on a traditional SysV machine, where
      5 jmp_bufs don't preserve signal masks.  I'm not worrying about this till
      6 someone reports it as a bug :-). */
      7 
      8 #if HAVE_SIGSETJMP
      9 #else
     10 #define sigjmp_buf jmp_buf
     11 #define sigsetjmp(x,y) setjmp(x)
     12 #define siglongjmp longjmp
     13 #endif /* HAVE_SIGSETJMP */
     14 
     15 
     16 /* Certain braindamaged environments don't define jmp_buf as an array,
     17 so wrap it in a structure.  Potentially, we could use configure to do
     18 this only where it needs to be done, but the effort is probably not
     19 worth it. */
     20 
     21 struct Jbwrap {
     22 	sigjmp_buf j;
     23 };