[devel] Reverted changes to call png_longjmp in contrib/gregbook

where it is not appropriate.  If mainprog->jmpbuf is used by setjmp,
then png_longjmp cannot be used.
Reversed patch to remove error handler when the jmp_buf is stored in the
main program structure, not the png_struct.
The error handler is needed because the default handler in libpng will
always use the jmp_buf in the library control structure; this is never
set.  The gregbook code is a useful example because, even though it
uses setjmp/longjmp, it shows how error handling can be implemented
using control mechanisms not directly supported by libpng.  The
technique will work correctly with mechanisms such as Microsoft
Structure Exceptions or C++ exceptions (compiler willing - note that gcc
does not by default support interworking of C and C++ error handling.)
This commit is contained in:
Glenn Randers-Pehrson
2010-06-28 20:17:48 -05:00
parent 6cac43c974
commit 73e28ef13d
9 changed files with 122 additions and 21 deletions

View File

@@ -26,8 +26,6 @@
- 1.14: added support for X resources (thanks to Gerhard Niklasch)
- 2.00: dual-licensed (added GNU GPL)
- 2.01: fixed improper display of usage screen on PNG error(s)
- 2.02: removed special error-handling which is no longer needed
because of the new libpng png_longjmp() feature in libpng-1.5.0.
---------------------------------------------------------------------------