openbsd-ports/graphics/glpng/patches/patch-src_glpng_c
naddy 8c18b08ac5 Fix build with png-1.5.
All fixes from/via NetBSD pkgsrc.  The people there did a lot of
heavy lifting.
2011-07-08 20:36:09 +00:00

43 lines
1.2 KiB
Plaintext

$OpenBSD: patch-src_glpng_c,v 1.2 2011/07/08 20:36:09 naddy Exp $
Fix build with png-1.5.
--- src/glpng.c.orig Mon Jul 10 21:27:10 2000
+++ src/glpng.c Wed Jul 6 18:02:53 2011
@@ -29,7 +29,7 @@
#include <GL/gl.h>
#include <stdlib.h>
#include <math.h>
-#include "png/png.h"
+#include <libpng/png.h>
/* Used to decide if GL/gl.h supports the paletted extension */
#ifdef GL_COLOR_INDEX1_EXT
@@ -276,7 +276,7 @@ int APIENTRY pngLoadRawF(FILE *fp, pngRawInfo *pinfo)
endinfo = png_create_info_struct(png);
// DH: added following lines
- if (setjmp(png->jmpbuf))
+ if (setjmp(png_jmpbuf(png)))
{
png_destroy_read_struct(&png, &info, &endinfo);
return 0;
@@ -380,7 +380,7 @@ int APIENTRY pngLoadF(FILE *fp, int mipmap, int trans,
endinfo = png_create_info_struct(png);
// DH: added following lines
- if (setjmp(png->jmpbuf))
+ if (setjmp(png_jmpbuf(png)))
{
png_destroy_read_struct(&png, &info, &endinfo);
return 0;
@@ -559,7 +559,7 @@ int APIENTRY pngLoadF(FILE *fp, int mipmap, int trans,
#define ALPHA *q
switch (trans) {
- case PNG_CALLBACK:
+ case PNG_CALLBACKT:
FORSTART
ALPHA = AlphaCallback((unsigned char) r, (unsigned char) g, (unsigned char) b);
FOREND