Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Nov 2015 18:40:36 +0000 (UTC)
From:      Antoine Brodin <antoine@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r401388 - head/astro/xplanet/files
Message-ID:  <201511121840.tACIeaGx026474@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: antoine
Date: Thu Nov 12 18:40:35 2015
New Revision: 401388
URL: https://svnweb.freebsd.org/changeset/ports/401388

Log:
  Allow building with giflib 5.1
  
  PR:		204492

Modified:
  head/astro/xplanet/files/patch-src_libimage_gif.c

Modified: head/astro/xplanet/files/patch-src_libimage_gif.c
==============================================================================
--- head/astro/xplanet/files/patch-src_libimage_gif.c	Thu Nov 12 18:35:53 2015	(r401387)
+++ head/astro/xplanet/files/patch-src_libimage_gif.c	Thu Nov 12 18:40:35 2015	(r401388)
@@ -95,7 +95,19 @@
                      return(0);
                  }
              }
-@@ -178,7 +218,11 @@ write_gif(const char *filename, int widt
+@@ -154,7 +194,11 @@ read_gif(const char *filename, int *widt
+     
+     free(buffer);
+ 
++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5
++    DGifCloseFile(infile, NULL);
++#else
+     DGifCloseFile(infile);
++#endif
+     return(1);
+ }
+ 
+@@ -178,7 +222,11 @@ write_gif(const char *filename, int widt
          return(0);
      }
  
@@ -107,7 +119,7 @@
  
      for (i = 0; i < width * height; i++)
      {
-@@ -187,10 +231,15 @@ write_gif(const char *filename, int widt
+@@ -187,10 +235,15 @@ write_gif(const char *filename, int widt
          blue[i]  = (GifByteType) rgb[3*i+2];
      }
    
@@ -124,7 +136,7 @@
          return(0);
      }
  
-@@ -198,24 +247,36 @@ write_gif(const char *filename, int widt
+@@ -198,24 +251,36 @@ write_gif(const char *filename, int widt
      free(green);
      free(blue);
  
@@ -166,7 +178,7 @@
          return(0);
      }
  
-@@ -224,7 +285,11 @@ write_gif(const char *filename, int widt
+@@ -224,7 +289,11 @@ write_gif(const char *filename, int widt
      {
          if (EGifPutLine(outfile, ptr, width) == GIF_ERROR)
          {
@@ -179,11 +191,16 @@
              return(0);
          }
          ptr += width;
-@@ -233,7 +298,7 @@ write_gif(const char *filename, int widt
+@@ -232,8 +301,12 @@ write_gif(const char *filename, int widt
+ 
      EGifSpew(outfile);
  
++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5
++    if (EGifCloseFile(outfile, NULL) == GIF_ERROR) 
++#else
      if (EGifCloseFile(outfile) == GIF_ERROR) 
 -        PrintGifError();
++#endif
 +        fprintf(stderr, "Can't close GIF file %s\n", filename);
  
      free(buffer);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511121840.tACIeaGx026474>