summaryrefslogtreecommitdiff
path: root/pcr/emacs-lucid/emacs-24.3-giflib5.patch
blob: f58c31907002c7818ec74137a40384a372215a84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
--- src/image.c
+++ src/image.c	2013-05-21 15:49:41.945819346 +0000
@@ -7192,7 +7192,11 @@ gif_load (struct frame *f, struct image
 	}
 
       /* Open the GIF file.  */
+#if GIFLIB_MAJOR < 5
       gif = fn_DGifOpenFileName (SSDATA (file));
+#else
+      gif = fn_DGifOpenFileName (SSDATA (file), NULL);
+#endif
       if (gif == NULL)
 	{
 	  image_error ("Cannot open `%s'", file, Qnil);
@@ -7213,7 +7217,11 @@ gif_load (struct frame *f, struct image
       memsrc.len = SBYTES (specified_data);
       memsrc.index = 0;
 
+#if GIFLIB_MAJOR < 5
       gif = fn_DGifOpen (&memsrc, gif_read_from_memory);
+#else
+      gif = fn_DGifOpen (&memsrc, gif_read_from_memory, NULL);
+#endif
       if (!gif)
 	{
 	  image_error ("Cannot open memory source `%s'", img->spec, Qnil);
@@ -7225,7 +7225,11 @@
   if (!check_image_size (f, gif->SWidth, gif->SHeight))
     {
       image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
+#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1
+      fn_DGifCloseFile (gif, NULL);
+#else
       fn_DGifCloseFile (gif);
+#endif
       return 0;
     }
 
@@ -7234,7 +7238,11 @@
   if (rc == GIF_ERROR || gif->ImageCount <= 0)
     {
       image_error ("Error reading `%s'", img->spec, Qnil);
+#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1
+      fn_DGifCloseFile (gif, NULL);
+#else
       fn_DGifCloseFile (gif);
+#endif
       return 0;
     }
 
@@ -7246,7 +7254,11 @@
       {
 	image_error ("Invalid image number `%s' in image `%s'",
 		     image_number, img->spec);
+#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1
+	fn_DGifCloseFile (gif, NULL);
+#else
 	fn_DGifCloseFile (gif);
+#endif
 	return 0;
       }
   }
@@ -7264,14 +7276,22 @@
   if (!check_image_size (f, width, height))
     {
       image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
+#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1
+      fn_DGifCloseFile (gif, NULL);
+#else
       fn_DGifCloseFile (gif);
+#endif
       return 0;
     }
 
   /* Create the X image and pixmap.  */
   if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap))
     {
+#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1
+      fn_DGifCloseFile (gif, NULL);
+#else
       fn_DGifCloseFile (gif);
+#endif
       return 0;
     }
 
@@ -7447,7 +7467,11 @@
 			    Fcons (make_number (gif->ImageCount),
 				   img->lisp_data));
 
+#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1
+  fn_DGifCloseFile (gif, NULL);
+#else
   fn_DGifCloseFile (gif);
+#endif
 
   /* Maybe fill in the background field while we have ximg handy. */
   if (NILP (image_spec_value (img->spec, QCbackground, NULL)))