OpenJDK / aarch32-port / jdk9 / jdk
changeset 10113:b5f284a0059b
8026385: [macosx] (awt) setjmp/longjmp changes the process signal mask on OS X
Summary: Use _setjmp/_longjmp instead
Reviewed-by: prr, anthony
Contributed-by: David DeHaven <david.dehaven@oracle.com>
author | ddehaven |
---|---|
date | Mon, 19 May 2014 23:21:39 +0400 |
parents | 706c54018d1c |
children | 6a2c3105351c |
files | src/share/native/sun/awt/image/jpeg/imageioJPEG.c src/share/native/sun/awt/image/jpeg/jpegdecoder.c src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c src/share/native/sun/awt/splashscreen/splashscreen_png.c |
diffstat | 4 files changed, 23 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/native/sun/awt/image/jpeg/imageioJPEG.c Mon May 19 10:03:58 2014 -0700 +++ b/src/share/native/sun/awt/image/jpeg/imageioJPEG.c Mon May 19 23:21:39 2014 +0400 @@ -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;
--- a/src/share/native/sun/awt/image/jpeg/jpegdecoder.c Mon May 19 10:03:58 2014 -0700 +++ b/src/share/native/sun/awt/image/jpeg/jpegdecoder.c Mon May 19 23:21:39 2014 +0400 @@ -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. */
--- a/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c Mon May 19 10:03:58 2014 -0700 +++ b/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c Mon May 19 23:21:39 2014 +0400 @@ -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
--- a/src/share/native/sun/awt/splashscreen/splashscreen_png.c Mon May 19 10:03:58 2014 -0700 +++ b/src/share/native/sun/awt/splashscreen/splashscreen_png.c Mon May 19 23:21:39 2014 +0400 @@ -71,7 +71,12 @@ 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; }