summaryrefslogtreecommitdiff
path: root/emulators/vba/patches/patch-ag
blob: dbbc13dee81ffe3be9debf4c95d338f893507a72 (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
$NetBSD: patch-ag,v 1.3 2012/09/29 21:27:14 dholland Exp $

- Fix build with png-1.5.
- Do not use void * as a synonym for gzFile, as gzFile is no longer
  void * in libz 1.2.6.
- Use const syntax correctly: const void * != void *const.

--- src/Util.cpp.orig	2004-05-20 17:42:37.000000000 +0000
+++ src/Util.cpp
@@ -47,7 +47,7 @@ extern "C" {
 #define _stricmp strcasecmp
 #endif // ! _MSC_VER
 
-static int (*utilGzWriteFunc)(gzFile, const voidp, unsigned int) = NULL;
+static int (*utilGzWriteFunc)(gzFile, voidpc, unsigned int) = NULL;
 static int (*utilGzReadFunc)(gzFile, voidp, unsigned int) = NULL;
 static int (*utilGzCloseFunc)(gzFile) = NULL;
 
@@ -79,7 +79,7 @@ bool utilWritePNGFile(const char *fileNa
     return false;
   }
 
-  if(setjmp(png_ptr->jmpbuf)) {
+  if(setjmp(png_jmpbuf(png_ptr))) {
     png_destroy_write_struct(&png_ptr,NULL);
     fclose(fp);
     return false;
@@ -984,7 +984,7 @@ void utilWriteData(gzFile gzFile, variab
 
 gzFile utilGzOpen(const char *file, const char *mode)
 {
-  utilGzWriteFunc = (int (*)(void *,void * const, unsigned int))gzwrite;
+  utilGzWriteFunc = (int (*)(gzFile, const void *, unsigned int))gzwrite;
   utilGzReadFunc = gzread;
   utilGzCloseFunc = gzclose;