--- pgp/src/ztailor.h 2018/04/24 16:38:25 1.1.1.2 +++ pgp/src/ztailor.h 2018/04/24 16:43:27 1.1.1.6 @@ -1,16 +1,5 @@ /* tailor.h -- Not copyrighted 1991 Mark Adler */ -/* const's are inconsistently used across ANSI libraries--kill for all - header files. */ -#ifdef __GNUC__ -# if __GNUC__ != 2 -# define const -# endif -#else -# define const -#endif - - /* Use prototypes and ANSI libraries if __STDC__ */ #ifdef __STDC__ # ifndef PROTO @@ -20,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 */ @@ -61,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 -# define fcalloc(nitems,itemsize) halloc((long)(nitems),(itemsize)) +# 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 */ +#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 @@ -93,20 +116,8 @@ #endif /* ?MSDOS */ -/* Define void, voidp, and extent (size_t) */ #include -#ifdef MODERN -# if !defined(M_XENIX) && !defined(__GNUC__) -# include -# endif /* !M_XENIX */ -# include - typedef void voidp; -#else /* !MODERN */ -#ifndef M_XENIX -# define void int -#endif - typedef char voidp; -#endif /* ?MODERN */ +#include typedef unsigned int extent; /* Get types and stat */ @@ -128,7 +139,6 @@ typedef unsigned int extent; /* For Pyramid */ #ifdef pyr # define strrchr rindex -# define ZMEM #endif /* pyr */ @@ -148,7 +158,8 @@ typedef unsigned int extent; * 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