Add PNG_SKIP_SETJMP_CHECK macro

This commit is contained in:
Glenn Randers-Pehrson 2009-04-20 13:07:01 -05:00
parent d07e9b03c4
commit 92d0fe938f
3 changed files with 28 additions and 15 deletions

View File

@ -86,7 +86,9 @@ version 1.2.36beta04 [April 5, 2009]
Fixed potential memory leak of "new_name" in png_write_iCCP() (Ralph Giles) Fixed potential memory leak of "new_name" in png_write_iCCP() (Ralph Giles)
version 1.2.36beta05 [April 13, 2009] version 1.2.36beta05 [April 13, 2009]
None. Added "ifndef PNG_SKIP_SETJMP_CHECK" block in pngconf.h to allow
application code writers to bypass the check for multiple inclusion
of setjmp.h when they know that it is safe to ignore the situation.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net

View File

@ -2353,7 +2353,10 @@ version 1.2.36beta04 [April 5, 2009]
Fixed potential memory leak of "new_name" in png_write_iCCP() (Ralph Giles) Fixed potential memory leak of "new_name" in png_write_iCCP() (Ralph Giles)
version 1.2.36beta05 [April 13, 2009] version 1.2.36beta05 [April 13, 2009]
None. Added "ifndef PNG_SKIP_SETJMP_CHECK" block in pngconf.h to allow
application code writers to bypass the check for multiple inclusion
of setjmp.h when they know that it is safe to ignore the situation.
Made some cosmetic changes to whitespace in pngtest output.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -314,8 +314,15 @@
#ifdef PNG_SETJMP_SUPPORTED #ifdef PNG_SETJMP_SUPPORTED
/* This is an attempt to force a single setjmp behaviour on Linux. If /* This is an attempt to force a single setjmp behaviour on Linux. If
* the X config stuff didn't define _BSD_SOURCE we wouldn't need this. * the X config stuff didn't define _BSD_SOURCE we wouldn't need this.
*
* You can bypass this test if you know that your application uses exactly
* the same setjmp.h that was included when libpng was built. Only define
* PNG_SKIP_SETJMP_CHECK while building your application, prior to the
* application's '#include "png.h"'. Don't define PNG_SKIP_SETJMP_CHECK
* while building a separate libpng library for general use.
*/ */
# ifndef PNG_SKIP_SETJMP_CHECK
# ifdef __linux__ # ifdef __linux__
# ifdef _BSD_SOURCE # ifdef _BSD_SOURCE
# define PNG_SAVE_BSD_SOURCE # define PNG_SAVE_BSD_SOURCE
@ -325,10 +332,11 @@
/* If you encounter a compiler error here, see the explanation /* If you encounter a compiler error here, see the explanation
* near the end of INSTALL. * near the end of INSTALL.
*/ */
__pngconf.h__ already includes setjmp.h; __pngconf.h__ in libpng already includes setjmp.h;
__dont__ include it again.; __dont__ include it again.;
# endif # endif
# endif /* __linux__ */ # endif /* __linux__ */
# endif /* PNG_SKIP_SETJMP_CHECK */
/* include setjmp.h for error handling */ /* include setjmp.h for error handling */
# include <setjmp.h> # include <setjmp.h>