--- pgp/src/ztailor.h 2018/04/24 16:38:25 1.1.1.2 +++ pgp/src/ztailor.h 2018/04/24 16:39:09 1.1.1.3 @@ -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,19 +50,31 @@ /* 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 */ # 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)) +# endif /* __GNUC__ */ # endif /* ?__TURBOC__ */ +# ifdef NOFAR +# define huge +# define far +# define near +# endif #else /* !MSDOS */ # define huge # define far @@ -82,6 +83,16 @@ # define farfree free # define fcalloc calloc #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 +# endif /* MSDOS */ +#endif /* __GNUC__ */ /* Define MSVMS if either MSDOS or VMS defined */ #ifdef MSDOS @@ -93,20 +104,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 +127,6 @@ typedef unsigned int extent; /* For Pyramid */ #ifdef pyr # define strrchr rindex -# define ZMEM #endif /* pyr */