gnu: calibre: Update to 5.14.0.
[jackhill/guix/guix.git] / gnu / packages / patches / xplanet-1.3.1-libimage_gif.c.patch
CommitLineData
77704cb1
VK
1Origin: $NetBSD: patch-src_libimage_gif.c,v 1.4 2019/11/16 17:36:28 ng0 Exp $
2
3Modified by: R Veera Kumar <vkor@vkten.in> 2020-03-28; change to patch -p1
4
5diff -uNr xplanet-1.3.1/src/libimage/gif.c xplanet-1.3.1.new/src/libimage/gif.c
6--- xplanet-1.3.1/src/libimage/gif.c 2013-02-17 01:07:47.000000000 +0530
7+++ xplanet-1.3.1.new/src/libimage/gif.c 2020-03-28 22:15:24.444309199 +0530
8@@ -21,7 +21,7 @@
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <string.h>
12-
13+#include <stdbool.h>
14 #include <gif_lib.h>
15
16 /*
17@@ -178,8 +178,12 @@
18 *BufferP++ = ColorMapEntry->Blue;
19 }
20 }
21-
22+
23+#if GIFLIB_MAJOR >= 5
24+ if (DGifCloseFile(GifFile, NULL) == GIF_ERROR) {
25+#else
26 if (DGifCloseFile(GifFile) == GIF_ERROR) {
27+#endif
28 return(0);
29 }
30
31@@ -493,7 +497,11 @@
32 static void QuitGifError(GifFileType *GifFile)
33 {
34 fprintf(stderr, "Error writing GIF file\n");
35+#if GIFLIB_MAJOR >= 5
36+ if (GifFile != NULL) EGifCloseFile(GifFile, NULL);
37+#else
38 if (GifFile != NULL) EGifCloseFile(GifFile);
39+#endif
40 }
41
42 int
43@@ -589,7 +597,11 @@
44 Ptr += width;
45 }
46
47+#if GIFLIB_MAJOR >= 5
48+ if (EGifCloseFile(GifFile, NULL) == GIF_ERROR)
49+#else
50 if (EGifCloseFile(GifFile) == GIF_ERROR)
51+#endif
52
53 {
54 QuitGifError(GifFile);