summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpixel <pixel>2003-10-09 04:47:27 +0000
committerpixel <pixel>2003-10-09 04:47:27 +0000
commitd2ea5b4ea490388ea5fb5cc7a54bafd464d13243 (patch)
treefc14ecab74fff3556c97dfe10d92961920aa1f2a
parent0a1ad13e6d89ceeb90b89a22b5577559c7c97366 (diff)
Yay for mingw32
-rw-r--r--include/generic.h6
-rw-r--r--lib/zlib/src/gzio.c4
-rw-r--r--lib/zlib/src/maketree.c85
3 files changed, 5 insertions, 90 deletions
diff --git a/include/generic.h b/include/generic.h
index 40d95e7..c31f8d3 100644
--- a/include/generic.h
+++ b/include/generic.h
@@ -59,7 +59,7 @@ typedef Uint32 DWord;
typedef int32 ssize_t;
#endif
-#if defined __linux__ || defined sun || defined __solaris__ || defined __CYGWIN32__ || defined FORCE64
+#if defined __linux__ || defined sun || defined __solaris__ || defined __CYGWIN32__ || defined __MINGW32__ || defined FORCE64
typedef long long int64;
typedef unsigned long long uint64;
#else
@@ -72,7 +72,7 @@ typedef unsigned _int64 uint64;
#endif
#ifndef PACKED
-#if defined __linux__ || defined sun || defined __solaris__ || defined __CYGWIN32__
+#if defined __linux__ || defined sun || defined __solaris__ || defined __CYGWIN32__ || defined __MINGW32__
#define PACKED __attribute__((packed))
#else // PACKED
#define PACKED
@@ -80,7 +80,7 @@ typedef unsigned _int64 uint64;
#endif // !PACKED
#ifndef PPACKED
-#if defined __linux__ || defined sun || defined __solaris__ || defined __CYGWIN32__
+#if defined __linux__ || defined sun || defined __solaris__ || defined __CYGWIN32__ || defined __MINGW32__
#define PPACKED
#else // PACKED
#define PPACKED __declspec(align(1))
diff --git a/lib/zlib/src/gzio.c b/lib/zlib/src/gzio.c
index 65183a5..3c861fd 100644
--- a/lib/zlib/src/gzio.c
+++ b/lib/zlib/src/gzio.c
@@ -5,7 +5,7 @@
* Compile this file with -DNO_DEFLATE to avoid the compression code.
*/
-/* @(#) $Id: gzio.c,v 1.1 2003-09-14 18:16:26 pixel Exp $ */
+/* @(#) $Id: gzio.c,v 1.2 2003-10-09 04:47:27 pixel Exp $ */
#include <stdio.h>
@@ -485,7 +485,7 @@ char * ZEXPORT gzgets(file, buf, len)
*/
int ZEXPORT gzwrite (file, buf, len)
gzFile file;
- const voidp buf;
+ cvoidp buf;
unsigned len;
{
gz_stream *s = (gz_stream*)file;
diff --git a/lib/zlib/src/maketree.c b/lib/zlib/src/maketree.c
deleted file mode 100644
index a16d4b1..0000000
--- a/lib/zlib/src/maketree.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/* maketree.c -- make inffixed.h table for decoding fixed codes
- * Copyright (C) 1995-2002 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-/* This program is included in the distribution for completeness.
- You do not need to compile or run this program since inffixed.h
- is already included in the distribution. To use this program
- you need to compile zlib with BUILDFIXED defined and then compile
- and link this program with the zlib library. Then the output of
- this program can be piped to inffixed.h. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "zutil.h"
-#include "inftrees.h"
-
-/* simplify the use of the inflate_huft type with some defines */
-#define exop word.what.Exop
-#define bits word.what.Bits
-
-/* generate initialization table for an inflate_huft structure array */
-void maketree(uInt b, inflate_huft *t)
-{
- int i, e;
-
- i = 0;
- while (1)
- {
- e = t[i].exop;
- if (e && (e & (16+64)) == 0) /* table pointer */
- {
- fprintf(stderr, "maketree: cannot initialize sub-tables!\n");
- exit(1);
- }
- if (i % 4 == 0)
- printf("\n ");
- printf(" {{{%u,%u}},%u}", t[i].exop, t[i].bits, t[i].base);
- if (++i == (1<<b))
- break;
- putchar(',');
- }
- puts("");
-}
-
-/* create the fixed tables in C initialization syntax */
-void main(void)
-{
- int r;
- uInt bl, bd;
- inflate_huft *tl, *td;
- z_stream z;
-
- z.zalloc = zcalloc;
- z.opaque = (voidpf)0;
- z.zfree = zcfree;
- r = inflate_trees_fixed(&bl, &bd, &tl, &td, &z);
- if (r)
- {
- fprintf(stderr, "inflate_trees_fixed error %d\n", r);
- return;
- }
- puts("/* inffixed.h -- table for decoding fixed codes");
- puts(" * Generated automatically by the maketree.c program");
- puts(" */");
- puts("");
- puts("/* WARNING: this file should *not* be used by applications. It is");
- puts(" part of the implementation of the compression library and is");
- puts(" subject to change. Applications should only use zlib.h.");
- puts(" */");
- puts("");
- printf("local uInt fixed_bl = %d;\n", bl);
- printf("local uInt fixed_bd = %d;\n", bd);
- printf("local inflate_huft fixed_tl[] = {");
- maketree(bl, tl);
- puts(" };");
- printf("local inflate_huft fixed_td[] = {");
- maketree(bd, td);
- puts(" };");
-}