svn commit: r375632 - head/textproc/gladtex/files

Antoine Brodin antoine at FreeBSD.org
Fri Dec 26 16:49:00 UTC 2014


Author: antoine
Date: Fri Dec 26 16:48:58 2014
New Revision: 375632
URL: https://svnweb.freebsd.org/changeset/ports/375632
QAT: https://qat.redports.org/buildarchive/r375632/

Log:
  Allow building with either giflib 4.2 or 5.0

Modified:
  head/textproc/gladtex/files/patch-eqn2img.c

Modified: head/textproc/gladtex/files/patch-eqn2img.c
==============================================================================
--- head/textproc/gladtex/files/patch-eqn2img.c	Fri Dec 26 16:11:24 2014	(r375631)
+++ head/textproc/gladtex/files/patch-eqn2img.c	Fri Dec 26 16:48:58 2014	(r375632)
@@ -1,6 +1,6 @@
---- ./eqn2img.c.orig	2013-03-07 15:44:58.000000000 +0100
-+++ ./eqn2img.c	2013-03-07 15:47:58.000000000 +0100
-@@ -367,7 +367,7 @@
+--- eqn2img.c.orig	2013-01-27 04:17:45 UTC
++++ eqn2img.c
+@@ -367,7 +367,7 @@ png_bytepp png_read(char *filename, int 
    info_ptr = png_create_info_struct(png_ptr);
    assert(info_ptr);
    
@@ -9,7 +9,7 @@
      png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
      fclose(fp);
      return NULL;
-@@ -580,7 +580,7 @@
+@@ -580,7 +580,7 @@ int png_write(png_bytepp image, char *im
    assert(info_ptr);
  
    /* error handling, libpng longjmps here on any error */
@@ -18,7 +18,39 @@
      png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
      fclose(fp);
      return -1;
-@@ -715,7 +715,7 @@
+@@ -623,19 +623,31 @@ int gif_write(png_bytepp image, char *im
+   };
+ 
+   if(img_name) {
++#if GIFLIB_MAJOR >= 5
++    fp = EGifOpenFileName(img_name, 0, NULL);
++#else
+     fp = EGifOpenFileName(img_name, 0);
++#endif
+     if(!fp)
+       return -1;
+   }
+   else
++#if GIFLIB_MAJOR >= 5
++    fp = EGifOpenFileHandle(STDOUT_FILENO, NULL);
++#else
+     fp = EGifOpenFileHandle(STDOUT_FILENO);
++#endif
+ 
+   for(i=0; i<256; i++) {
+     pal[i].Red = (i*background.red + (255-i)*foreground.red)/255;
+     pal[i].Green = (i*background.green + (255-i)*foreground.green)/255;
+     pal[i].Blue = (i*background.blue + (255-i)*foreground.blue)/255;
+   }
++#if GIFLIB_MAJOR >= 5
++  color_map = GifMakeMapObject(256, pal);
++#else
+   color_map = MakeMapObject(256, pal);
++#endif
+ 
+   /* EGifSetGifVersion("89a"); this causes segfault (but is really required for transparency, I think) */
+   EGifPutScreenDesc(fp, width, height, 256, 255, color_map);
+@@ -715,7 +727,7 @@ int to_ps(char *basename, int verbose) {
      fprintf(stderr, " -> ps");
  
    cmd = NEW(char, 2*strlen(basename) + 46);


More information about the svn-ports-head mailing list