Commit f3606ef7 authored by Barry Fishman's avatar Barry Fishman Committed by Glenn Morris

Handle giflib 5 changes (tiny change)

* configure.ac: Update for giflib 5. 

* src/image.c (GIFLIB_MAJOR): Ensure it's defined.
(DGifOpen, DGifOpenFileName): Handle giflib 5 syntax.  (Bug#15531)
parent 9db13baf
2013-10-10 Barry Fishman <barry_fishman@acm.org> (tiny change)
* configure.ac: Update for giflib 5. (Bug#15531)
2013-10-08 Eli Zaretskii <eliz@gnu.org> 2013-10-08 Eli Zaretskii <eliz@gnu.org>
* configure.ac (HAVE_MENUS): Define unconditionally. * configure.ac (HAVE_MENUS): Define unconditionally.
......
...@@ -3106,8 +3106,9 @@ elif test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no" \ ...@@ -3106,8 +3106,9 @@ elif test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no" \
|| test "${HAVE_W32}" = "yes"; then || test "${HAVE_W32}" = "yes"; then
AC_CHECK_HEADER(gif_lib.h, AC_CHECK_HEADER(gif_lib.h,
# EGifPutExtensionLast only exists from version libungif-4.1.0b1. # EGifPutExtensionLast only exists from version libungif-4.1.0b1.
# Earlier versions can crash Emacs. # Earlier versions can crash Emacs, but version 5.0 removes EGifPutExtensionLast.
[AC_CHECK_LIB(gif, EGifPutExtensionLast, HAVE_GIF=yes, HAVE_GIF=maybe)]) [AC_CHECK_LIB(gif, GifMakeMapObject, HAVE_GIF=yes,
[AC_CHECK_LIB(gif, EGifPutExtensionLast, HAVE_GIF=yes, HAVE_GIF=maybe)])])
if test "$HAVE_GIF" = yes; then if test "$HAVE_GIF" = yes; then
LIBGIF=-lgif LIBGIF=-lgif
......
2013-10-10 Barry Fishman <barry_fishman@acm.org> (tiny change)
* image.c (GIFLIB_MAJOR): Ensure it's defined.
(DGifOpen, DGifOpenFileName): Handle giflib 5 syntax. (Bug#15531)
2013-10-09 Paul Eggert <eggert@cs.ucla.edu> 2013-10-09 Paul Eggert <eggert@cs.ucla.edu>
* fns.c (sxhash_bool_vector): Fix buffer read overrun. * fns.c (sxhash_bool_vector): Fix buffer read overrun.
......
...@@ -7219,14 +7219,22 @@ gif_image_p (Lisp_Object object) ...@@ -7219,14 +7219,22 @@ gif_image_p (Lisp_Object object)
#endif /* HAVE_NTGUI */ #endif /* HAVE_NTGUI */
#ifndef GIFLIB_MAJOR
#define GIFLIB_MAJOR 0
#endif
#ifdef WINDOWSNT #ifdef WINDOWSNT
/* GIF library details. */ /* GIF library details. */
DEF_IMGLIB_FN (int, DGifCloseFile, (GifFileType *)); DEF_IMGLIB_FN (int, DGifCloseFile, (GifFileType *));
DEF_IMGLIB_FN (int, DGifSlurp, (GifFileType *)); DEF_IMGLIB_FN (int, DGifSlurp, (GifFileType *));
#if GIFLIB_MAJOR < 5
DEF_IMGLIB_FN (GifFileType *, DGifOpen, (void *, InputFunc)); DEF_IMGLIB_FN (GifFileType *, DGifOpen, (void *, InputFunc));
DEF_IMGLIB_FN (GifFileType *, DGifOpenFileName, (const char *)); DEF_IMGLIB_FN (GifFileType *, DGifOpenFileName, (const char *));
#else
DEF_IMGLIB_FN (GifFileType *, DGifOpen, (void *, InputFunc, int *));
DEF_IMGLIB_FN (GifFileType *, DGifOpenFileName, (const char *, int *));
#endif
static bool static bool
init_gif_functions (void) init_gif_functions (void)
...@@ -7316,7 +7324,11 @@ gif_load (struct frame *f, struct image *img) ...@@ -7316,7 +7324,11 @@ gif_load (struct frame *f, struct image *img)
} }
/* Open the GIF file. */ /* Open the GIF file. */
#if GIFLIB_MAJOR < 5
gif = fn_DGifOpenFileName (SSDATA (file)); gif = fn_DGifOpenFileName (SSDATA (file));
#else
gif = fn_DGifOpenFileName (SSDATA (file), NULL);
#endif
if (gif == NULL) if (gif == NULL)
{ {
image_error ("Cannot open `%s'", file, Qnil); image_error ("Cannot open `%s'", file, Qnil);
...@@ -7337,7 +7349,11 @@ gif_load (struct frame *f, struct image *img) ...@@ -7337,7 +7349,11 @@ gif_load (struct frame *f, struct image *img)
memsrc.len = SBYTES (specified_data); memsrc.len = SBYTES (specified_data);
memsrc.index = 0; memsrc.index = 0;
#if GIFLIB_MAJOR < 5
gif = fn_DGifOpen (&memsrc, gif_read_from_memory); gif = fn_DGifOpen (&memsrc, gif_read_from_memory);
#else
gif = fn_DGifOpen (&memsrc, gif_read_from_memory, NULL);
#endif
if (!gif) if (!gif)
{ {
image_error ("Cannot open memory source `%s'", img->spec, Qnil); image_error ("Cannot open memory source `%s'", img->spec, Qnil);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment