diff options
| author | Eli Zaretskii | 2010-12-31 14:38:06 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2010-12-31 14:38:06 +0200 |
| commit | 5be1c984b7839d528cf9e83c68b9055c29bed751 (patch) | |
| tree | bd7d1c8021a0f2b48edb6e58beb3ce195cbea162 /src | |
| parent | 89dc29d9c8e7957d047e9e9abe95334d70982814 (diff) | |
| download | emacs-5be1c984b7839d528cf9e83c68b9055c29bed751.tar.gz emacs-5be1c984b7839d528cf9e83c68b9055c29bed751.zip | |
Fix bug #7716 with PNG image support libraries on Windows.
src/image.c <Qlibpng_version>: New variable.
(syms_of_image): Intern and staticpro it. Set its value to the
version of PNG library we were compiled with.
(my_png_error, png_load): Avoid GCC warnings about direct access
to png_ptr->jmpbuf.
lisp/term/w32-win.el (image-library-alist): Set up correctly for
libpng versions both before and after 1.4.0.
admin/nt/README.W32: Update the information about PNG support libraries.
nt/INSTALL: Update the information about PNG support libraries.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/image.c | 29 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index b4bafbce1b3..19cf253db7e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2010-12-31 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * image.c <Qlibpng_version>: New variable. | ||
| 4 | (syms_of_image): Intern and staticpro it. Set its value to the | ||
| 5 | version of PNG library we were compiled with. | ||
| 6 | (my_png_error, png_load): Avoid GCC warnings about direct access | ||
| 7 | to png_ptr->jmpbuf. (Bug#7716) | ||
| 8 | |||
| 1 | 2010-12-27 Stefan Monnier <monnier@iro.umontreal.ca> | 9 | 2010-12-27 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 10 | ||
| 3 | * .gdbinit (xgetptr): Fix the union+lsb case. | 11 | * .gdbinit (xgetptr): Fix the union+lsb case. |
diff --git a/src/image.c b/src/image.c index 0fa0a0cd064..8fce8489bf7 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -94,6 +94,11 @@ typedef struct w32_bitmap_record Bitmap_Record; | |||
| 94 | without modifying lots of files). */ | 94 | without modifying lots of files). */ |
| 95 | extern void x_query_colors (struct frame *f, XColor *colors, int ncolors); | 95 | extern void x_query_colors (struct frame *f, XColor *colors, int ncolors); |
| 96 | extern void x_query_color (struct frame *f, XColor *color); | 96 | extern void x_query_color (struct frame *f, XColor *color); |
| 97 | |||
| 98 | /* Version of libpng that we were compiled with, or -1 if no PNG | ||
| 99 | support was compiled in. This is tested by w32-win.el to correctly | ||
| 100 | set up the alist used to search for PNG libraries. */ | ||
| 101 | Lisp_Object Qlibpng_version; | ||
| 97 | #endif /* HAVE_NTGUI */ | 102 | #endif /* HAVE_NTGUI */ |
| 98 | 103 | ||
| 99 | #ifdef HAVE_NS | 104 | #ifdef HAVE_NS |
| @@ -5652,8 +5657,15 @@ my_png_error (png_ptr, msg) | |||
| 5652 | char *msg; | 5657 | char *msg; |
| 5653 | { | 5658 | { |
| 5654 | xassert (png_ptr != NULL); | 5659 | xassert (png_ptr != NULL); |
| 5660 | /* Avoid compiler warning about deprecated direct access to | ||
| 5661 | png_ptr's fields in libpng versions 1.4.x. */ | ||
| 5655 | image_error ("PNG error: %s", build_string (msg), Qnil); | 5662 | image_error ("PNG error: %s", build_string (msg), Qnil); |
| 5663 | #if PNG_LIBPNG_VER_MAJOR > 1 \ | ||
| 5664 | || (PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR >= 4) | ||
| 5665 | longjmp (png_jmpbuf (png_ptr), 1); | ||
| 5666 | #else | ||
| 5656 | longjmp (png_ptr->jmpbuf, 1); | 5667 | longjmp (png_ptr->jmpbuf, 1); |
| 5668 | #endif | ||
| 5657 | } | 5669 | } |
| 5658 | 5670 | ||
| 5659 | 5671 | ||
| @@ -5827,9 +5839,16 @@ png_load (f, img) | |||
| 5827 | return 0; | 5839 | return 0; |
| 5828 | } | 5840 | } |
| 5829 | 5841 | ||
| 5842 | /* Avoid compiler warning about deprecated direct access to | ||
| 5843 | png_ptr's fields in libpng versions 1.4.x. */ | ||
| 5844 | #if PNG_LIBPNG_VER_MAJOR > 1 \ | ||
| 5845 | || (PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR >= 4) | ||
| 5830 | /* Set error jump-back. We come back here when the PNG library | 5846 | /* Set error jump-back. We come back here when the PNG library |
| 5831 | detects an error. */ | 5847 | detects an error. */ |
| 5848 | if (setjmp (png_jmpbuf (png_ptr))) | ||
| 5849 | #else | ||
| 5832 | if (setjmp (png_ptr->jmpbuf)) | 5850 | if (setjmp (png_ptr->jmpbuf)) |
| 5851 | #endif | ||
| 5833 | { | 5852 | { |
| 5834 | error: | 5853 | error: |
| 5835 | if (png_ptr) | 5854 | if (png_ptr) |
| @@ -8453,6 +8472,16 @@ non-numeric, there is no explicit limit on the size of images. */); | |||
| 8453 | staticpro (&QCpt_height); | 8472 | staticpro (&QCpt_height); |
| 8454 | #endif /* HAVE_GHOSTSCRIPT */ | 8473 | #endif /* HAVE_GHOSTSCRIPT */ |
| 8455 | 8474 | ||
| 8475 | #ifdef HAVE_NTGUI | ||
| 8476 | Qlibpng_version = intern_c_string ("libpng-version"); | ||
| 8477 | staticpro (&Qlibpng_version); | ||
| 8478 | #if HAVE_PNG | ||
| 8479 | SET_SYMBOL_VAL (XSYMBOL (Qlibpng_version), make_number (PNG_LIBPNG_VER)); | ||
| 8480 | #else | ||
| 8481 | SET_SYMBOL_VAL (XSYMBOL (Qlibpng_version), make_number (-1)); | ||
| 8482 | #endif | ||
| 8483 | #endif | ||
| 8484 | |||
| 8456 | #if defined (HAVE_XPM) || defined (HAVE_NS) | 8485 | #if defined (HAVE_XPM) || defined (HAVE_NS) |
| 8457 | Qxpm = intern_c_string ("xpm"); | 8486 | Qxpm = intern_c_string ("xpm"); |
| 8458 | staticpro (&Qxpm); | 8487 | staticpro (&Qxpm); |