--- pgp/src/ztailor.h 2018/04/24 16:37:52 1.1.1.1 +++ pgp/src/ztailor.h 2018/04/24 16:45:16 1.1.1.7 @@ -1,10 +1,5 @@ /* tailor.h -- Not copyrighted 1991 Mark Adler */ -/* const's are inconsistently used across ANSI libraries--kill for all - header files. */ -#define const - - /* Use prototypes and ANSI libraries if __STDC__ */ #ifdef __STDC__ # ifndef PROTO @@ -14,8 +9,8 @@ #endif /* __STDC__ */ -/* Use prototypes and ANSI libraries if Silicon Graphics */ -#ifdef sgi +/* Use prototypes and ANSI libraries */ +#if defined(sgi) || defined(mips) # ifndef PROTO # define PROTO # endif /* !PROTO */ @@ -55,27 +50,61 @@ /* Allow far and huge allocation for small model (Microsoft C or Turbo C) */ +/* unless NOFAR defined (needed for ANSI mode compilations) */ +/* But if we're using DJGPP, and want to use the optimized 386 assembler */ +/* zmatch routines, we can't use DYN_ALLOC. But gcc has virtual memory... */ #ifdef MSDOS -# ifndef DYN_ALLOC -# define DYN_ALLOC +# ifndef __GNUC__ +# ifndef DYN_ALLOC +# define DYN_ALLOC +# endif # endif # ifdef __TURBOC__ # include +# define fcalloc calloc /* Assumes that all arrays are < 64K for MSDOS */ +# define fcfree free # else /* !__TURBOC__ */ -# include -# define farmalloc _fmalloc -# define farfree _ffree +# ifndef __GNUC__ +# include +# define farmalloc _fmalloc +# define farfree _ffree +# define fcalloc(nitems,itemsize) halloc((long)(nitems),(itemsize)) +# define fcfree hfree +# endif /* __GNUC__ */ # endif /* ?__TURBOC__ */ +# ifdef NOFAR +# define huge +# define far +# define near +# endif #else /* !MSDOS */ +# ifdef __QNX__ +# undef huge +# undef far +# undef near +# undef farmalloc +# undef farfree +# undef fcalloc +# endif /* __QNX__ */ # define huge # define far # define near # define farmalloc malloc # define farfree free +# define fcalloc calloc +# define fcfree free #endif /* ?MSDOS */ - -#define fcalloc calloc -/* Assumes that all arrays are < 64K for MSDOS */ +#ifdef __GNUC__ +# ifdef MSDOS /* MSDOS GNU C == DJGPP */ +# define huge +# define far +# define near +# define farmalloc malloc +# define farfree free +# define fcalloc calloc +# define fcfree free +# endif /* MSDOS */ +#endif /* __GNUC__ */ /* Define MSVMS if either MSDOS or VMS defined */ #ifdef MSDOS @@ -87,30 +116,23 @@ #endif /* ?MSDOS */ -/* Define void, voidp, and extent (size_t) */ #include -#ifdef MODERN -# if !defined(M_XENIX) && !defined(__GNUC__) -# include -# endif /* !M_XENIX */ -# include - typedef size_t extent; - typedef void voidp; -#else /* !MODERN */ - typedef unsigned int extent; -#ifndef M_XENIX -# define void int -#endif - typedef char voidp; -#endif /* ?MODERN */ +#include +typedef unsigned int extent; /* Get types and stat */ #ifdef VMS # include # include #else /* !VMS */ -# include -# include +#ifndef __PUREC__ +# ifndef C370 +# ifndef MACTC5 +# include +# include +# endif /* MACTC5 */ +# endif /* C370 */ +#endif #endif /* ?VMS */ @@ -123,7 +145,6 @@ /* For Pyramid */ #ifdef pyr # define strrchr rindex -# define ZMEM #endif /* pyr */ @@ -143,7 +164,8 @@ * This is not mandatory, just a speed optimization. The compressed * output is strictly identical. */ -#if defined(MSDOS) || defined(M_XENIX) || defined(i386) || defined(mc68020) || defined(vax) +#if defined(MSDOS) || defined(M_XENIX) || defined(i386) || \ +defined(mc68020) || defined(vax) # define UNALIGNED_OK #endif