8026385: [macosx] (awt) setjmp/longjmp changes the process signal mask on OS X

Use _setjmp/_longjmp instead

Reviewed-by: prr, anthony
This commit is contained in:
David DeHaven 2014-05-19 23:21:39 +04:00 committed by David Dehaven
parent ba597e32a7
commit bf464ca61b
4 changed files with 23 additions and 0 deletions

View File

@ -56,6 +56,12 @@
#undef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#ifdef __APPLE__
/* use setjmp/longjmp versions that do not save/restore the signal mask */
#define setjmp _setjmp
#define longjmp _longjmp
#endif
/* Cached Java method ids */
static jmethodID JPEGImageReader_readInputDataID;
static jmethodID JPEGImageReader_skipInputBytesID;

View File

@ -47,6 +47,12 @@
#include <jpeglib.h>
#include "jerror.h"
#ifdef __APPLE__
/* use setjmp/longjmp versions that do not save/restore the signal mask */
#define setjmp _setjmp
#define longjmp _longjmp
#endif
/* The method IDs we cache. Note that the last two belongs to the
* java.io.InputStream class.
*/

View File

@ -30,6 +30,12 @@
#include <setjmp.h>
#ifdef __APPLE__
/* use setjmp/longjmp versions that do not save/restore the signal mask */
#define setjmp _setjmp
#define longjmp _longjmp
#endif
/* stream input handling */
typedef struct

View File

@ -71,7 +71,12 @@ SplashDecodePng(Splash * splash, png_rw_ptr read_func, void *io_ptr)
goto done;
}
#ifdef __APPLE__
/* use setjmp/longjmp versions that do not save/restore the signal mask */
if (_setjmp(png_set_longjmp_fn(png_ptr, _longjmp, sizeof(jmp_buf)))) {
#else
if (setjmp(png_jmpbuf(png_ptr))) {
#endif
goto done;
}