diff options
| author | Barry Fishman | 2013-10-09 20:37:44 -0400 |
|---|---|---|
| committer | Glenn Morris | 2013-10-09 20:37:44 -0400 |
| commit | f3606ef766bcec86789316a05949f1e67a51e7c1 (patch) | |
| tree | 62a4ec7d368cf17f3f224c7a13f5877819800321 /src | |
| parent | 9db13baf0c3c16e92861cc98467e6fb0e92c769d (diff) | |
| download | emacs-f3606ef766bcec86789316a05949f1e67a51e7c1.tar.gz emacs-f3606ef766bcec86789316a05949f1e67a51e7c1.zip | |
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)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/image.c | 16 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index f46733d1ebe..7e196668796 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-10-10 Barry Fishman <barry_fishman@acm.org> (tiny change) | ||
| 2 | |||
| 3 | * image.c (GIFLIB_MAJOR): Ensure it's defined. | ||
| 4 | (DGifOpen, DGifOpenFileName): Handle giflib 5 syntax. (Bug#15531) | ||
| 5 | |||
| 1 | 2013-10-09 Paul Eggert <eggert@cs.ucla.edu> | 6 | 2013-10-09 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 7 | ||
| 3 | * fns.c (sxhash_bool_vector): Fix buffer read overrun. | 8 | * fns.c (sxhash_bool_vector): Fix buffer read overrun. |
diff --git a/src/image.c b/src/image.c index e429830cc96..c414f5b91bd 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -7219,14 +7219,22 @@ gif_image_p (Lisp_Object object) | |||
| 7219 | 7219 | ||
| 7220 | #endif /* HAVE_NTGUI */ | 7220 | #endif /* HAVE_NTGUI */ |
| 7221 | 7221 | ||
| 7222 | #ifndef GIFLIB_MAJOR | ||
| 7223 | #define GIFLIB_MAJOR 0 | ||
| 7224 | #endif | ||
| 7222 | 7225 | ||
| 7223 | #ifdef WINDOWSNT | 7226 | #ifdef WINDOWSNT |
| 7224 | 7227 | ||
| 7225 | /* GIF library details. */ | 7228 | /* GIF library details. */ |
| 7226 | DEF_IMGLIB_FN (int, DGifCloseFile, (GifFileType *)); | 7229 | DEF_IMGLIB_FN (int, DGifCloseFile, (GifFileType *)); |
| 7227 | DEF_IMGLIB_FN (int, DGifSlurp, (GifFileType *)); | 7230 | DEF_IMGLIB_FN (int, DGifSlurp, (GifFileType *)); |
| 7231 | #if GIFLIB_MAJOR < 5 | ||
| 7228 | DEF_IMGLIB_FN (GifFileType *, DGifOpen, (void *, InputFunc)); | 7232 | DEF_IMGLIB_FN (GifFileType *, DGifOpen, (void *, InputFunc)); |
| 7229 | DEF_IMGLIB_FN (GifFileType *, DGifOpenFileName, (const char *)); | 7233 | DEF_IMGLIB_FN (GifFileType *, DGifOpenFileName, (const char *)); |
| 7234 | #else | ||
| 7235 | DEF_IMGLIB_FN (GifFileType *, DGifOpen, (void *, InputFunc, int *)); | ||
| 7236 | DEF_IMGLIB_FN (GifFileType *, DGifOpenFileName, (const char *, int *)); | ||
| 7237 | #endif | ||
| 7230 | 7238 | ||
| 7231 | static bool | 7239 | static bool |
| 7232 | init_gif_functions (void) | 7240 | init_gif_functions (void) |
| @@ -7316,7 +7324,11 @@ gif_load (struct frame *f, struct image *img) | |||
| 7316 | } | 7324 | } |
| 7317 | 7325 | ||
| 7318 | /* Open the GIF file. */ | 7326 | /* Open the GIF file. */ |
| 7327 | #if GIFLIB_MAJOR < 5 | ||
| 7319 | gif = fn_DGifOpenFileName (SSDATA (file)); | 7328 | gif = fn_DGifOpenFileName (SSDATA (file)); |
| 7329 | #else | ||
| 7330 | gif = fn_DGifOpenFileName (SSDATA (file), NULL); | ||
| 7331 | #endif | ||
| 7320 | if (gif == NULL) | 7332 | if (gif == NULL) |
| 7321 | { | 7333 | { |
| 7322 | image_error ("Cannot open `%s'", file, Qnil); | 7334 | image_error ("Cannot open `%s'", file, Qnil); |
| @@ -7337,7 +7349,11 @@ gif_load (struct frame *f, struct image *img) | |||
| 7337 | memsrc.len = SBYTES (specified_data); | 7349 | memsrc.len = SBYTES (specified_data); |
| 7338 | memsrc.index = 0; | 7350 | memsrc.index = 0; |
| 7339 | 7351 | ||
| 7352 | #if GIFLIB_MAJOR < 5 | ||
| 7340 | gif = fn_DGifOpen (&memsrc, gif_read_from_memory); | 7353 | gif = fn_DGifOpen (&memsrc, gif_read_from_memory); |
| 7354 | #else | ||
| 7355 | gif = fn_DGifOpen (&memsrc, gif_read_from_memory, NULL); | ||
| 7356 | #endif | ||
| 7341 | if (!gif) | 7357 | if (!gif) |
| 7342 | { | 7358 | { |
| 7343 | image_error ("Cannot open memory source `%s'", img->spec, Qnil); | 7359 | image_error ("Cannot open memory source `%s'", img->spec, Qnil); |