diff options
| author | Chong Yidong | 2010-01-24 18:03:13 -0500 |
|---|---|---|
| committer | Chong Yidong | 2010-01-24 18:03:13 -0500 |
| commit | 285d07e27afc99de2562afa62c24fd5834721ed1 (patch) | |
| tree | 4ae4f340e3d4b365e6123485d399e59cbde11c8c /src | |
| parent | c2f1d6d81e9a513db096bb6986f284f736d55cbe (diff) | |
| download | emacs-285d07e27afc99de2562afa62c24fd5834721ed1.tar.gz emacs-285d07e27afc99de2562afa62c24fd5834721ed1.zip | |
Use png_sig_cmp to allow linking with libpng 1.4.0.
* image.c (png_load): Use png_sig_cmp instead of the obsolete png_check_sig, which has been removed in libpng 1.4.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/image.c | 14 |
2 files changed, 12 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index d20b3113ba7..00dbad31a8e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2010-01-24 Eric Bélanger <snowmaniscool@gmail.com> (tiny change) | ||
| 2 | |||
| 3 | * image.c (png_load): Use png_sig_cmp instead of the obsolete | ||
| 4 | png_check_sig, which has been removed in libpng 1.4. | ||
| 5 | |||
| 1 | 2010-01-23 Giorgos Keramidas <keramida@ceid.upatras.gr> (tiny change) | 6 | 2010-01-23 Giorgos Keramidas <keramida@ceid.upatras.gr> (tiny change) |
| 2 | 7 | ||
| 3 | * filelock.c: Include utmp.h only when HAVE_UTMP_H (FreeBSD 9.x | 8 | * filelock.c: Include utmp.h only when HAVE_UTMP_H (FreeBSD 9.x |
diff --git a/src/image.c b/src/image.c index 9c11f466807..1265b900c6c 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -33,7 +33,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 33 | #else | 33 | #else |
| 34 | # include <png.h> | 34 | # include <png.h> |
| 35 | #endif | 35 | #endif |
| 36 | #endif | 36 | #endif |
| 37 | 37 | ||
| 38 | #include <setjmp.h> | 38 | #include <setjmp.h> |
| 39 | 39 | ||
| @@ -3051,7 +3051,7 @@ xbm_load (f, img) | |||
| 3051 | int nbytes, i; | 3051 | int nbytes, i; |
| 3052 | /* Windows mono bitmaps are reversed compared with X. */ | 3052 | /* Windows mono bitmaps are reversed compared with X. */ |
| 3053 | invertedBits = bits; | 3053 | invertedBits = bits; |
| 3054 | nbytes = (img->width + BITS_PER_CHAR - 1) / BITS_PER_CHAR | 3054 | nbytes = (img->width + BITS_PER_CHAR - 1) / BITS_PER_CHAR |
| 3055 | * img->height; | 3055 | * img->height; |
| 3056 | bits = (char *) alloca(nbytes); | 3056 | bits = (char *) alloca(nbytes); |
| 3057 | for (i = 0; i < nbytes; i++) | 3057 | for (i = 0; i < nbytes; i++) |
| @@ -5559,7 +5559,7 @@ png_image_p (object) | |||
| 5559 | /* PNG library details. */ | 5559 | /* PNG library details. */ |
| 5560 | 5560 | ||
| 5561 | DEF_IMGLIB_FN (png_get_io_ptr); | 5561 | DEF_IMGLIB_FN (png_get_io_ptr); |
| 5562 | DEF_IMGLIB_FN (png_check_sig); | 5562 | DEF_IMGLIB_FN (png_sig_cmp); |
| 5563 | DEF_IMGLIB_FN (png_create_read_struct); | 5563 | DEF_IMGLIB_FN (png_create_read_struct); |
| 5564 | DEF_IMGLIB_FN (png_create_info_struct); | 5564 | DEF_IMGLIB_FN (png_create_info_struct); |
| 5565 | DEF_IMGLIB_FN (png_destroy_read_struct); | 5565 | DEF_IMGLIB_FN (png_destroy_read_struct); |
| @@ -5590,7 +5590,7 @@ init_png_functions (Lisp_Object libraries) | |||
| 5590 | return 0; | 5590 | return 0; |
| 5591 | 5591 | ||
| 5592 | LOAD_IMGLIB_FN (library, png_get_io_ptr); | 5592 | LOAD_IMGLIB_FN (library, png_get_io_ptr); |
| 5593 | LOAD_IMGLIB_FN (library, png_check_sig); | 5593 | LOAD_IMGLIB_FN (library, png_sig_cmp); |
| 5594 | LOAD_IMGLIB_FN (library, png_create_read_struct); | 5594 | LOAD_IMGLIB_FN (library, png_create_read_struct); |
| 5595 | LOAD_IMGLIB_FN (library, png_create_info_struct); | 5595 | LOAD_IMGLIB_FN (library, png_create_info_struct); |
| 5596 | LOAD_IMGLIB_FN (library, png_destroy_read_struct); | 5596 | LOAD_IMGLIB_FN (library, png_destroy_read_struct); |
| @@ -5615,7 +5615,7 @@ init_png_functions (Lisp_Object libraries) | |||
| 5615 | #else | 5615 | #else |
| 5616 | 5616 | ||
| 5617 | #define fn_png_get_io_ptr png_get_io_ptr | 5617 | #define fn_png_get_io_ptr png_get_io_ptr |
| 5618 | #define fn_png_check_sig png_check_sig | 5618 | #define fn_png_sig_cmp png_sig_cmp |
| 5619 | #define fn_png_create_read_struct png_create_read_struct | 5619 | #define fn_png_create_read_struct png_create_read_struct |
| 5620 | #define fn_png_create_info_struct png_create_info_struct | 5620 | #define fn_png_create_info_struct png_create_info_struct |
| 5621 | #define fn_png_destroy_read_struct png_destroy_read_struct | 5621 | #define fn_png_destroy_read_struct png_destroy_read_struct |
| @@ -5762,7 +5762,7 @@ png_load (f, img) | |||
| 5762 | 5762 | ||
| 5763 | /* Check PNG signature. */ | 5763 | /* Check PNG signature. */ |
| 5764 | if (fread (sig, 1, sizeof sig, fp) != sizeof sig | 5764 | if (fread (sig, 1, sizeof sig, fp) != sizeof sig |
| 5765 | || !fn_png_check_sig (sig, sizeof sig)) | 5765 | || fn_png_sig_cmp (sig, 0, sizeof sig)) |
| 5766 | { | 5766 | { |
| 5767 | image_error ("Not a PNG file: `%s'", file, Qnil); | 5767 | image_error ("Not a PNG file: `%s'", file, Qnil); |
| 5768 | UNGCPRO; | 5768 | UNGCPRO; |
| @@ -5779,7 +5779,7 @@ png_load (f, img) | |||
| 5779 | 5779 | ||
| 5780 | /* Check PNG signature. */ | 5780 | /* Check PNG signature. */ |
| 5781 | if (tbr.len < sizeof sig | 5781 | if (tbr.len < sizeof sig |
| 5782 | || !fn_png_check_sig (tbr.bytes, sizeof sig)) | 5782 | || fn_png_sig_cmp (tbr.bytes, 0, sizeof sig)) |
| 5783 | { | 5783 | { |
| 5784 | image_error ("Not a PNG image: `%s'", img->spec, Qnil); | 5784 | image_error ("Not a PNG image: `%s'", img->spec, Qnil); |
| 5785 | UNGCPRO; | 5785 | UNGCPRO; |