diff options
| author | Rasmus Lerdorf <rasmus@php.net> | 2008-03-18 21:14:28 +0000 |
|---|---|---|
| committer | Rasmus Lerdorf <rasmus@php.net> | 2008-03-18 21:14:28 +0000 |
| commit | 10afe5d96bc3d562958e905102de1db44188ac2b (patch) | |
| tree | 05f227c74ba3ef54abd2ed3da17b28ad97f1abd8 /Zend/zend.h | |
| parent | c9e0781d2abab740f81a620c27a30391a11466ab (diff) | |
| download | php-git-10afe5d96bc3d562958e905102de1db44188ac2b.tar.gz | |
Make the sigsetjmp change more robust. On systems that don't have
sigsetjmp use setjmp. Windows is of course weird in that it seems to
have sigsetjmp but not sigjmp_buf (??) so force it to use setjmp in
config.w32.h.in
Diffstat (limited to 'Zend/zend.h')
| -rw-r--r-- | Zend/zend.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Zend/zend.h b/Zend/zend.h index 2d7a21e1dc..5249f8c078 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -520,13 +520,23 @@ END_EXTERN_C() #define zend_bailout() _zend_bailout(__FILE__, __LINE__) +#ifdef HAVE_SIGSETJMP +# define SETJMP(a) sigsetjmp(a, 0) +# define LONGJMP(a,b) siglongjmp(a, b) +# define JMP_BUF sigjmp_buf +#else +# define SETJMP(a) setjmp(a) +# define LONGJMP(a,b) longjmp(a, b) +# define JMP_BUF jmp_buf +#endif + #define zend_try \ { \ - sigjmp_buf *__orig_bailout = EG(bailout); \ - sigjmp_buf __bailout; \ + JMP_BUF *__orig_bailout = EG(bailout); \ + JMP_BUF __bailout; \ \ EG(bailout) = &__bailout; \ - if (sigsetjmp(__bailout, 0)==0) { + if (SETJMP(__bailout)==0) { #define zend_catch \ } else { \ EG(bailout) = __orig_bailout; |
