aboutsummaryrefslogtreecommitdiff
path: root/textproc/gladtex
diff options
context:
space:
mode:
authorAntoine Brodin <antoine@FreeBSD.org>2014-12-26 16:48:58 +0000
committerAntoine Brodin <antoine@FreeBSD.org>2014-12-26 16:48:58 +0000
commit6266dd56ce45f3557c06760f7d7fac644e62353e (patch)
tree7fd8143d261d101e49e84f677584e12cc3cc580a /textproc/gladtex
parent8fa27a8450f68431b90b223e99f5ff0f23fef626 (diff)
Notes
Diffstat (limited to 'textproc/gladtex')
-rw-r--r--textproc/gladtex/files/patch-eqn2img.c42
1 files changed, 37 insertions, 5 deletions
diff --git a/textproc/gladtex/files/patch-eqn2img.c b/textproc/gladtex/files/patch-eqn2img.c
index c71ea7f5dc9d..1f7b034e9144 100644
--- a/textproc/gladtex/files/patch-eqn2img.c
+++ b/textproc/gladtex/files/patch-eqn2img.c
@@ -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);