diff options
author | marino <marino> | 2012-07-18 22:10:21 +0000 |
---|---|---|
committer | marino <marino> | 2012-07-18 22:10:21 +0000 |
commit | 70a9f74497d895202a3d3f01225cd4cf371d15b5 (patch) | |
tree | 2473fc2864ad90415fe76e5da7b080dba8178fb2 /emulators/ucon64 | |
parent | 630c187ae2886ac756373e9423746b268333356a (diff) | |
download | pkgsrc-70a9f74497d895202a3d3f01225cd4cf371d15b5.tar.gz |
emulators/ucon64: Fix for libz >= 1.2.6
As previously predicted, the horrible code in archive.c wouldn't last long
before breaking. There were a few dozen errors erupting when libz 1.2.7
header was used. The previous patch-af was appended, but the previous fix
for linux was changed because that was broken too.
Info: typedef of gzFile changed from void* at version 1.2.6, so its use
is no longer optional with libz versions >= 1.2.6.
Diffstat (limited to 'emulators/ucon64')
-rw-r--r-- | emulators/ucon64/Makefile | 4 | ||||
-rw-r--r-- | emulators/ucon64/distinfo | 4 | ||||
-rw-r--r-- | emulators/ucon64/patches/patch-af | 119 |
3 files changed, 121 insertions, 6 deletions
diff --git a/emulators/ucon64/Makefile b/emulators/ucon64/Makefile index cff30903773..89af8923762 100644 --- a/emulators/ucon64/Makefile +++ b/emulators/ucon64/Makefile @@ -1,9 +1,9 @@ -# $NetBSD: Makefile,v 1.8 2008/04/07 18:18:01 joerg Exp $ +# $NetBSD: Makefile,v 1.9 2012/07/18 22:10:21 marino Exp $ # DISTNAME= ucon64-2.0.0-src PKGNAME= ${DISTNAME:S/-src//} -PKGREVISION= 1 +PKGREVISION= 2 CATEGORIES= emulators MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=ucon64/} diff --git a/emulators/ucon64/distinfo b/emulators/ucon64/distinfo index e5b3c96eaaf..35fe84cd05b 100644 --- a/emulators/ucon64/distinfo +++ b/emulators/ucon64/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.5 2012/05/10 22:11:20 dholland Exp $ +$NetBSD: distinfo,v 1.6 2012/07/18 22:10:21 marino Exp $ SHA1 (ucon64-2.0.0-src.tar.gz) = 8782bbc2bf5760fafe3fa4cd02b67991d984a973 RMD160 (ucon64-2.0.0-src.tar.gz) = c28921cfae1a010db917b96be542c089690b374c @@ -8,4 +8,4 @@ SHA1 (patch-ab) = 25f5311844511674d5e64efe7c35cf86dacc34a9 SHA1 (patch-ac) = 9c7febe59e1c8e6959f56e34ced83a31fa54c294 SHA1 (patch-ad) = c41895de15bc2a48bf5de1535f03d070ade79ea3 SHA1 (patch-ae) = bfb38ecec2408deaaef881fa33943e2c45bccd4d -SHA1 (patch-af) = 84476b894a34bb1d7074526340eaa97fcbcfd0aa +SHA1 (patch-af) = 2f53d87dd40dfdfd90580161444d956df32207df diff --git a/emulators/ucon64/patches/patch-af b/emulators/ucon64/patches/patch-af index b8186b53aa5..f34248c60a5 100644 --- a/emulators/ucon64/patches/patch-af +++ b/emulators/ucon64/patches/patch-af @@ -1,4 +1,4 @@ -$NetBSD: patch-af,v 1.2 2012/05/10 22:11:20 dholland Exp $ +$NetBSD: patch-af,v 1.3 2012/07/18 22:10:21 marino Exp $ - don't declare own errno - fix build failure where gzgetc() is a macro (seen in a recent Linux @@ -8,6 +8,10 @@ XXX: what this code is doing (mixing gzFile* and FILE* indiscriminately XXX: without even casting) is vile and will probably stop compiling at XXX: some point. +JRM: That point arrived. The garbage spewed when compiled with +JRM: zlib >= 1.2.6. Cast gzFile everywhere to fix it. +JRM: David's gzgetc fix was changed; it broke too. + --- misc/archive.c.orig 2004-12-12 01:16:54.000000000 +0000 +++ misc/archive.c @@ -48,9 +48,6 @@ Foundation, Inc., 675 Mass Ave, Cambridg @@ -20,12 +24,123 @@ XXX: some point. int fsizeof (const char *filename) // If USE_ZLIB is defined this function is very slow. Please avoid to use +@@ -84,15 +81,15 @@ fsizeof (const char *filename) + } + #if 1 + // This is not much faster than the other method +- while (!gzeof (file)) +- gzseek (file, 1024 * 1024, SEEK_CUR); +- size = gztell (file); ++ while (!gzeof ((gzFile)file)) ++ gzseek ((gzFile)file, 1024 * 1024, SEEK_CUR); ++ size = gztell ((gzFile)file); + #else + // Is there a more efficient way to determine the uncompressed size? + while ((bytesread = gzread (file, buf, MAXBUFSIZE)) > 0) + size += bytesread; + #endif +- gzclose (file); ++ gzclose ((gzFile)file); + return size; + } + else if (magic[0] == 'P' && magic[1] == 'K' && magic[2] == 0x03 && magic[3] == 0x04) +@@ -384,7 +381,7 @@ fclose2 (FILE *file) + if (fmode == FM_NORMAL) + return fclose (file); + else if (fmode == FM_GZIP) +- return gzclose (file); ++ return gzclose ((gzFile)file); + else if (fmode == FM_ZIP) + { + unzCloseCurrentFile (file); +@@ -416,12 +413,12 @@ fseek2 (FILE *file, long offset, int mod + if (mode == SEEK_END) // zlib doesn't support SEEK_END + { + // Note that this is _slow_... +- while (!gzeof (file)) ++ while (!gzeof ((gzFile)file)) + { +- gzgetc (file); // necessary for _uncompressed_ files in order to set EOF +- gzseek (file, 1024 * 1024, SEEK_CUR); ++ gzgetc ((gzFile)file); // necessary for _uncompressed_ files in order to set EOF ++ gzseek ((gzFile)file, 1024 * 1024, SEEK_CUR); + } +- offset += gztell (file); ++ offset += gztell ((gzFile)file); + mode = SEEK_SET; + } + /* +@@ -433,8 +430,8 @@ fseek2 (FILE *file, long offset, int mod + DJGPP, Cygwin & GNU/Linux). It clears the EOF indicator. + */ + if (!finfo->compressed) +- gzrewind (file); +- return gzseek (file, offset, mode) == -1 ? -1 : 0; ++ gzrewind ((gzFile)file); ++ return gzseek ((gzFile)file, offset, mode) == -1 ? -1 : 0; + } + else if (finfo->fmode == FM_ZIP) + { +@@ -476,7 +473,7 @@ fread2 (void *buffer, size_t size, size_ + return fread (buffer, size, number, file); + else if (fmode == FM_GZIP) + { +- int n = gzread (file, buffer, number * size); ++ int n = gzread ((gzFile)file, buffer, number * size); + return n / size; + } + else if (fmode == FM_ZIP) @@ -498,7 +495,7 @@ fgetc2 (FILE *file) if (fmode == FM_NORMAL) return fgetc (file); else if (fmode == FM_GZIP) - return gzgetc (file); -+ return gzgetc ((struct gzFile *)file); ++ return gzgetc ((gzFile)file); else if (fmode == FM_ZIP) { char c; +@@ -521,7 +518,7 @@ fgets2 (char *buffer, int maxlength, FIL + return fgets (buffer, maxlength, file); + else if (fmode == FM_GZIP) + { +- char *retval = gzgets (file, buffer, maxlength); ++ char *retval = gzgets ((gzFile)file, buffer, maxlength); + return retval == Z_NULL ? NULL : retval; + } + else if (fmode == FM_ZIP) +@@ -556,7 +553,7 @@ feof2 (FILE *file) + if (fmode == FM_NORMAL) + return feof (file); + else if (fmode == FM_GZIP) +- return gzeof (file); ++ return gzeof ((gzFile)file); + else if (fmode == FM_ZIP) + return unzeof (file); // returns feof() of the "current file" + else +@@ -578,7 +575,7 @@ fwrite2 (const void *buffer, size_t size + return fwrite (buffer, size, number, file); + else if (fmode == FM_GZIP) + { +- int n = gzwrite (file, (void *) buffer, number * size); ++ int n = gzwrite ((gzFile)file, (void *) buffer, number * size); + return n / size; + } + else +@@ -596,7 +593,7 @@ fputc2 (int character, FILE *file) + if (fmode == FM_NORMAL) + return fputc (character, file); + else if (fmode == FM_GZIP) +- return gzputc (file, character); ++ return gzputc ((gzFile)file, character); + else + return EOF; // writing to zip files is not supported + #define fputc fputc2 +@@ -612,7 +609,7 @@ ftell2 (FILE *file) + if (fmode == FM_NORMAL) + return ftell (file); + else if (fmode == FM_GZIP) +- return gztell (file); ++ return gztell ((gzFile)file); + else if (fmode == FM_ZIP) + return unztell (file); // returns ftell() of the "current file" + else |