sourcepawn/decompiler/zlib/zconf.h
author David Anderson <dvander@alliedmods.net>
Wed Feb 25 20:07:12 2009 -0500 (2009-02-25)
changeset 2607 f3b8bbe17f85
parent 2320 88550c031d23
permissions -rw-r--r--
Backed out changeset fa286305bd3f
     1 /* zconf.h -- configuration of the zlib compression library
     2  * Copyright (C) 1995-2005 Jean-loup Gailly.
     3  * For conditions of distribution and use, see copyright notice in zlib.h
     4  */
     5 
     6 /* @(#) $Id$ */
     7 
     8 #ifndef ZCONF_H
     9 #define ZCONF_H
    10 
    11 #if defined(__MSDOS__) && !defined(MSDOS)
    12 #  define MSDOS
    13 #endif
    14 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
    15 #  define OS2
    16 #endif
    17 #if defined(_WINDOWS) && !defined(WINDOWS)
    18 #  define WINDOWS
    19 #endif
    20 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
    21 #  ifndef WIN32
    22 #    define WIN32
    23 #  endif
    24 #endif
    25 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
    26 #  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
    27 #    ifndef SYS16BIT
    28 #      define SYS16BIT
    29 #    endif
    30 #  endif
    31 #endif
    32 
    33 /*
    34  * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
    35  * than 64k bytes at a time (needed on systems with 16-bit int).
    36  */
    37 #ifdef SYS16BIT
    38 #  define MAXSEG_64K
    39 #endif
    40 #ifdef MSDOS
    41 #  define UNALIGNED_OK
    42 #endif
    43 
    44 #ifdef __STDC_VERSION__
    45 #  ifndef STDC
    46 #    define STDC
    47 #  endif
    48 #  if __STDC_VERSION__ >= 199901L
    49 #    ifndef STDC99
    50 #      define STDC99
    51 #    endif
    52 #  endif
    53 #endif
    54 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
    55 #  define STDC
    56 #endif
    57 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
    58 #  define STDC
    59 #endif
    60 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
    61 #  define STDC
    62 #endif
    63 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
    64 #  define STDC
    65 #endif
    66 
    67 #if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
    68 #  define STDC
    69 #endif
    70 
    71 #ifndef STDC
    72 #  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
    73 #    define const       /* note: need a more gentle solution here */
    74 #  endif
    75 #endif
    76 
    77 /* Some Mac compilers merge all .h files incorrectly: */
    78 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
    79 #  define NO_DUMMY_DECL
    80 #endif
    81 
    82 /* Maximum value for memLevel in deflateInit2 */
    83 #ifndef MAX_MEM_LEVEL
    84 #  ifdef MAXSEG_64K
    85 #    define MAX_MEM_LEVEL 8
    86 #  else
    87 #    define MAX_MEM_LEVEL 9
    88 #  endif
    89 #endif
    90 
    91 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
    92  * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
    93  * created by gzip. (Files created by minigzip can still be extracted by
    94  * gzip.)
    95  */
    96 #ifndef MAX_WBITS
    97 #  define MAX_WBITS   15 /* 32K LZ77 window */
    98 #endif
    99 
   100 /* The memory requirements for deflate are (in bytes):
   101             (1 << (windowBits+2)) +  (1 << (memLevel+9))
   102  that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
   103  plus a few kilobytes for small objects. For example, if you want to reduce
   104  the default memory requirements from 256K to 128K, compile with
   105      make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
   106  Of course this will generally degrade compression (there's no free lunch).
   107 
   108    The memory requirements for inflate are (in bytes) 1 << windowBits
   109  that is, 32K for windowBits=15 (default value) plus a few kilobytes
   110  for small objects.
   111 */
   112 
   113                         /* Type declarations */
   114 
   115 #ifndef OF /* function prototypes */
   116 #  ifdef STDC
   117 #    define OF(args)  args
   118 #  else
   119 #    define OF(args)  ()
   120 #  endif
   121 #endif
   122 
   123 /* The following definitions for FAR are needed only for MSDOS mixed
   124  * model programming (small or medium model with some far allocations).
   125  * This was tested only with MSC; for other MSDOS compilers you may have
   126  * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
   127  * just define FAR to be empty.
   128  */
   129 #ifdef SYS16BIT
   130 #  if defined(M_I86SM) || defined(M_I86MM)
   131      /* MSC small or medium model */
   132 #    define SMALL_MEDIUM
   133 #    ifdef _MSC_VER
   134 #      define FAR _far
   135 #    else
   136 #      define FAR far
   137 #    endif
   138 #  endif
   139 #  if (defined(__SMALL__) || defined(__MEDIUM__))
   140      /* Turbo C small or medium model */
   141 #    define SMALL_MEDIUM
   142 #    ifdef __BORLANDC__
   143 #      define FAR _far
   144 #    else
   145 #      define FAR far
   146 #    endif
   147 #  endif
   148 #endif
   149 
   150 #if defined(WINDOWS) || defined(WIN32)
   151    /* If building or using zlib as a DLL, define ZLIB_DLL.
   152     * This is not mandatory, but it offers a little performance increase.
   153     */
   154 #  ifdef ZLIB_DLL
   155 #    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
   156 #      ifdef ZLIB_INTERNAL
   157 #        define ZEXTERN extern __declspec(dllexport)
   158 #      else
   159 #        define ZEXTERN extern __declspec(dllimport)
   160 #      endif
   161 #    endif
   162 #  endif  /* ZLIB_DLL */
   163    /* If building or using zlib with the WINAPI/WINAPIV calling convention,
   164     * define ZLIB_WINAPI.
   165     * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
   166     */
   167 #  ifdef ZLIB_WINAPI
   168 #    ifdef FAR
   169 #      undef FAR
   170 #    endif
   171 #    include <windows.h>
   172      /* No need for _export, use ZLIB.DEF instead. */
   173      /* For complete Windows compatibility, use WINAPI, not __stdcall. */
   174 #    define ZEXPORT WINAPI
   175 #    ifdef WIN32
   176 #      define ZEXPORTVA WINAPIV
   177 #    else
   178 #      define ZEXPORTVA FAR CDECL
   179 #    endif
   180 #  endif
   181 #endif
   182 
   183 #if defined (__BEOS__)
   184 #  ifdef ZLIB_DLL
   185 #    ifdef ZLIB_INTERNAL
   186 #      define ZEXPORT   __declspec(dllexport)
   187 #      define ZEXPORTVA __declspec(dllexport)
   188 #    else
   189 #      define ZEXPORT   __declspec(dllimport)
   190 #      define ZEXPORTVA __declspec(dllimport)
   191 #    endif
   192 #  endif
   193 #endif
   194 
   195 #ifndef ZEXTERN
   196 #  define ZEXTERN extern
   197 #endif
   198 #ifndef ZEXPORT
   199 #  define ZEXPORT
   200 #endif
   201 #ifndef ZEXPORTVA
   202 #  define ZEXPORTVA
   203 #endif
   204 
   205 #ifndef FAR
   206 #  define FAR
   207 #endif
   208 
   209 #if !defined(__MACTYPES__)
   210 typedef unsigned char  Byte;  /* 8 bits */
   211 #endif
   212 typedef unsigned int   uInt;  /* 16 bits or more */
   213 typedef unsigned long  uLong; /* 32 bits or more */
   214 
   215 #ifdef SMALL_MEDIUM
   216    /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
   217 #  define Bytef Byte FAR
   218 #else
   219    typedef Byte  FAR Bytef;
   220 #endif
   221 typedef char  FAR charf;
   222 typedef int   FAR intf;
   223 typedef uInt  FAR uIntf;
   224 typedef uLong FAR uLongf;
   225 
   226 #ifdef STDC
   227    typedef void const *voidpc;
   228    typedef void FAR   *voidpf;
   229    typedef void       *voidp;
   230 #else
   231    typedef Byte const *voidpc;
   232    typedef Byte FAR   *voidpf;
   233    typedef Byte       *voidp;
   234 #endif
   235 
   236 #if 0           /* HAVE_UNISTD_H -- this line is updated by ./configure */
   237 #  include <sys/types.h> /* for off_t */
   238 #  include <unistd.h>    /* for SEEK_* and off_t */
   239 #  ifdef VMS
   240 #    include <unixio.h>   /* for off_t */
   241 #  endif
   242 #  define z_off_t off_t
   243 #endif
   244 #ifndef SEEK_SET
   245 #  define SEEK_SET        0       /* Seek from beginning of file.  */
   246 #  define SEEK_CUR        1       /* Seek from current position.  */
   247 #  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
   248 #endif
   249 #ifndef z_off_t
   250 #  define z_off_t long
   251 #endif
   252 
   253 #if defined(__OS400__)
   254 #  define NO_vsnprintf
   255 #endif
   256 
   257 #if defined(__MVS__)
   258 #  define NO_vsnprintf
   259 #  ifdef FAR
   260 #    undef FAR
   261 #  endif
   262 #endif
   263 
   264 /* MVS linker does not support external names larger than 8 bytes */
   265 #if defined(__MVS__)
   266 #   pragma map(deflateInit_,"DEIN")
   267 #   pragma map(deflateInit2_,"DEIN2")
   268 #   pragma map(deflateEnd,"DEEND")
   269 #   pragma map(deflateBound,"DEBND")
   270 #   pragma map(inflateInit_,"ININ")
   271 #   pragma map(inflateInit2_,"ININ2")
   272 #   pragma map(inflateEnd,"INEND")
   273 #   pragma map(inflateSync,"INSY")
   274 #   pragma map(inflateSetDictionary,"INSEDI")
   275 #   pragma map(compressBound,"CMBND")
   276 #   pragma map(inflate_table,"INTABL")
   277 #   pragma map(inflate_fast,"INFA")
   278 #   pragma map(inflate_copyright,"INCOPY")
   279 #endif
   280 
   281 #endif /* ZCONF_H */