summaryrefslogtreecommitdiff
path: root/libraries/libglpng/libglpng-1.45-libpng15.patch
blob: 9308633536e9f23cf03b3eb04f3ba85ba33990a8 (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
diff -up libglpng-1.45.orig/include/GL/glpng.h~ libglpng-1.45.orig/include/GL/glpng.h
--- libglpng-1.45.orig/include/GL/glpng.h~	2011-12-06 22:14:59.000000000 +0100
+++ libglpng-1.45.orig/include/GL/glpng.h	2011-12-06 22:15:48.900673919 +0100
@@ -57,7 +57,7 @@ extern "C" {
 #define PNG_SIMPLEMIPMAP PNG_SIMPLEMIPMAPS
 
 /* Transparency parameters */
-#define PNG_CALLBACK  -3 /* Call the callback function to generate alpha   */
+#define PNG_CALLBACK_FUNC -3 /* Call the callback function to generate alpha   */
 #define PNG_ALPHA     -2 /* Use alpha channel in PNG file, if there is one */
 #define PNG_SOLID     -1 /* No transparency                                */
 #define PNG_STENCIL    0 /* Sets alpha to 0 for r=g=b=0, 1 otherwise       */
diff -up libglpng-1.45.orig/src/glpng.c~ libglpng-1.45.orig/src/glpng.c
--- libglpng-1.45.orig/src/glpng.c~	2011-12-06 19:38:53.000000000 +0100
+++ libglpng-1.45.orig/src/glpng.c	2011-12-06 22:13:34.501354149 +0100
@@ -282,7 +282,11 @@ int APIENTRY pngLoadRawF(FILE *fp, pngRa
 	if (!endinfo) return 0;
 
 	// DH: added following lines
+#if PNG_LIBPNG_VER >= 10400
+	if (setjmp(png_jmpbuf(png)))
+#else
 	if (setjmp(png->jmpbuf))
+#endif
 	{
 error:
 		png_destroy_read_struct(&png, &info, &endinfo);
@@ -402,7 +406,11 @@ int APIENTRY pngLoadF(FILE *fp, int mipm
 	if (!endinfo) return 0;
 
 	// DH: added following lines
+#if PNG_LIBPNG_VER >= 10400
+	if (setjmp(png_jmpbuf(png)))
+#else
 	if (setjmp(png->jmpbuf))
+#endif
 	{
 error:
 		png_destroy_read_struct(&png, &info, &endinfo);
@@ -603,7 +611,7 @@ error:
 			#define ALPHA *q
 
 			switch (trans) {
-				case PNG_CALLBACK:
+				case PNG_CALLBACK_FUNC:
 					FORSTART
 						ALPHA = AlphaCallback((unsigned char) r, (unsigned char) g, (unsigned char) b);
 					FOREND