--- pgp/src/ztailor.h 2018/04/24 16:37:52 1.1.1.1 +++ pgp/src/ztailor.h 2018/04/24 16:40:49 1.1.1.4 @@ -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,53 @@ /* 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 */ # 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,22 +108,9 @@ #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 @@ -123,7 +131,6 @@ /* For Pyramid */ #ifdef pyr # define strrchr rindex -# define ZMEM #endif /* pyr */