summaryrefslogtreecommitdiff
path: root/zconf.h
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-09-09 23:11:37 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-09-09 23:11:37 -0700
commit56bcb184fac036a45cb8937238d51778d0a796aa (patch)
tree7b127418b30e135f8ce27ec136038b5090540820 /zconf.h
parent25e5325501edade156e897f95afdaa2be78ad9a3 (diff)
downloadzlib-56bcb184fac036a45cb8937238d51778d0a796aa.tar.gz
zlib 0.99v0.99
Diffstat (limited to 'zconf.h')
-rw-r--r--zconf.h86
1 files changed, 63 insertions, 23 deletions
diff --git a/zconf.h b/zconf.h
index 3898094..e17520c 100644
--- a/zconf.h
+++ b/zconf.h
@@ -1,5 +1,5 @@
/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995 Jean-loup Gailly.
+ * Copyright (C) 1995-1996 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -9,22 +9,55 @@
#define _ZCONF_H
/*
- The library does not install any signal handler. It is recommended to
- add at least a handler for SIGSEGV when decompressing; the library checks
- the consistency of the input data whenever possible but may go nuts
- for some forms of corrupted input.
+ * People prefering a unique prefix for all types and library functions
+ * should compile with -DZ_PREFIX
*/
+#ifdef Z_PREFIX
+# define deflateInit_ z_deflateInit_
+# define deflate z_deflate
+# define deflateEnd z_deflateEnd
+# define inflateInit_ z_inflateInit_
+# define inflate z_inflate
+# define inflateEnd z_inflateEnd
+# define deflateInit2_ z_deflateInit2_
+# define deflateCopy z_deflateCopy
+# define deflateReset z_deflateReset
+# define deflateParams z_deflateParams
+# define inflateInit2_ z_inflateInit2_
+# define inflateSync z_inflateSync
+# define inflateReset z_inflateReset
+# define compress z_compress
+# define uncompress z_uncompress
+# define adler32 z_adler32
+# define crc32 z_crc32
+# define get_crc_table z_get_crc_table
+
+# define Byte z_Byte
+# define uInt z_uInt
+# define uLong z_uLong
+# define Bytef z_Bytef
+# define charf z_charf
+# define intf z_intf
+# define uIntf z_uIntf
+# define uLongf z_uLongf
+# define voidpf z_voidpf
+# define voidp z_voidp
+#endif
-/*
- * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
- * than 64k bytes at a time (needed on systems with 16-bit int).
- */
-#if defined(_GNUC__) && !defined(__32BIT__)
+#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
+# define WIN32
+#endif
+#if (defined(__GNUC__) || defined(WIN32)) && !defined(__32BIT__)
# define __32BIT__
#endif
#if defined(__MSDOS__) && !defined(MSDOS)
# define MSDOS
#endif
+
+/*
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
+ * than 64k bytes at a time (needed on systems with 16-bit int).
+ */
#if defined(MSDOS) && !defined(__32BIT__)
# define MAXSEG_64K
#endif
@@ -32,20 +65,20 @@
# define UNALIGNED_OK
#endif
-#ifndef STDC
-# if defined(MSDOS) || defined(__STDC__) || defined(__cplusplus)
-# define STDC
-# endif
+#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
+# define STDC
+#endif
+#if (defined(__STDC__) || defined(__cplusplus)) && !defined(STDC)
+# define STDC
#endif
-#ifndef STDC
-# ifndef const
-# define const
-# endif
+#if !defined(STDC) && !defined(const)
+# define const
#endif
#ifdef __MWERKS__ /* Metrowerks CodeWarrior declares fileno() in unix.h */
# include <unix.h>
+# define Byte _Byte /* Byte already used on Mac */
#endif
/* Maximum value for memLevel in deflateInit2 */
@@ -92,6 +125,7 @@
* just define FAR to be empty.
*/
#if defined(M_I86SM) || defined(M_I86MM) /* MSC small or medium model */
+# define SMALL_MEDIUM
# ifdef _MSC_VER
# define FAR __far
# else
@@ -99,20 +133,26 @@
# endif
#endif
#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
-# define FAR __far /* completely untested, just a best guess */
+# define SMALL_MEDIUM
+# define FAR __far
#endif
#ifndef FAR
# define FAR
#endif
+/* The Watcom compiler defines M_I86SM and __SMALL__ even in 32 bit mode */
+#if defined(__WATCOMC__) && defined(__386__)
+# undef FAR
+# undef SMALL_MEDIUM
+#endif
typedef unsigned char Byte; /* 8 bits */
typedef unsigned int uInt; /* 16 bits or more */
typedef unsigned long uLong; /* 32 bits or more */
-typedef Byte FAR Bytef;
-typedef char FAR charf;
-typedef int FAR intf;
-typedef uInt FAR uIntf;
+typedef Byte FAR Bytef;
+typedef char FAR charf;
+typedef int FAR intf;
+typedef uInt FAR uIntf;
typedef uLong FAR uLongf;
#ifdef STDC