1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
|
/* Copyright 1989 GROUPE BULL -- See license conditions in file COPYRIGHT
* Copyright 1989 Massachusetts Institute of Technology
*/
/*******************************\
* *
* Machine - dependent patches *
* *
\*******************************/
/*****************************************************************************\
* OS Description *
\*****************************************************************************/
/* To describe your OS, you can #define those flags:
*
* NO_GETPAGESIZE if you dont have getpagesize()
* SYSV_TIME if you cannot use BSD ftime function
* SYSV_STRINGS if you include <string.h> instead of <strings.h>
* SYSV_UTSNAME if you don't have gethostname()
* SYSV_SIGNALS if you dont have wait3()
* NO_BCOPY if you dont have bcopy and friends
* HAS_STRCHR if strchr already exists
* NO_MALLOC_DECLARE if your includes already declares char *malloc()
*/
#if defined(SYSV) || defined(SVR4) /* Generic SYSV */
#define NO_GETPAGESIZE
#define SYSV_TIME
#define SYSV_STRINGS
#define SYSV_UTSNAME
#define SYSV_SIGNALS
#ifndef VOID_MALLOC
#define VOID_MALLOC
#endif
#ifndef VOID_SIGNALS
#define VOID_SIGNALS
#endif
#define NO_BCOPY
#define HAS_STRCHR
#endif /* defined(SYSV) || defined(SVR4) */
#ifdef BOSF /* BULL OSF Unix. Mix of BSD and SYSV*/
#define SYSV_TIME
#define NO_MALLOC_DECLARE
#define HAS_STRCHR
#endif /* BOSF */
#ifdef __USLC__ /* UnixWare 1.1.2 (SVR4.2) C compiler */
#define DO_NOT_REDEFINE_MALLOC
#endif
/* BSD means no flags (normal) */
/*****************************************************************************\
* automatic customizations *
\*****************************************************************************/
#ifdef sparc
#define NO_BCOPY /* bzero buggy on sun4 */
#endif
#ifdef apollo /* no struct field acces on apollo */
#define NO_STRUCTURE_OFFSETS
#endif
#ifdef linux
#ifndef LINUX /* linux ==> LINUX */
#define LINUX
#endif
#endif
#ifdef LINUX
#ifndef _BSD_SOURCE
#define SYSV
#endif
#define VOID_SIGNALS
#define VOID_MALLOC
#define DO_NOT_REDEFINE_MALLOC
#endif /* LINUX */
#ifdef __FreeBSD__
#define SYSV_TIME
#define VOID_SIGNALS
#define VOID_MALLOC
#define DO_NOT_REDEFINE_MALLOC
#endif
#ifdef _AIX
#ifndef NEED_SELECT_H
#define NEED_SELECT_H
#endif /* !NEED_SELECT_H */
#endif /* _AIX */
/*****************************************************************************\
* bcopy *
\*****************************************************************************/
#ifdef NO_BCOPY
#define bcopy(source, dest, count) memcpy(dest, source, count)
#define bzero(dest, count) memset(dest, 0, count)
#define bcmp(source, dest, count) memcmp(source, dest, count)
#endif /* NO_BCOPY */
/*****************************************************************************\
* strchr implemented as index *
\*****************************************************************************/
#ifdef HAS_STRCHR
#ifdef DO_NOT_DECLARE_STRCHR
#define DECLARE_strchr
#define DECLARE_strrchr
#else
#define DECLARE_strchr extern char *strchr()
#define DECLARE_strrchr extern char *strrchr()
#endif
#else /* HAS_STRCHR */
#define DECLARE_strchr extern char *index()
#define DECLARE_strrchr extern char *rindex()
#define strchr(string, char) index(string, char)
#define strrchr(string, char) rindex(string, char)
#endif /* HAS_STRCHR */
#ifdef __GNUC__
#define Abs(x) __builtin_abs(x)
#endif
#ifdef __HIGHC__
#define Abs(x) _abs(x)
#endif
#ifdef USE_STANDARD_MALLOC
#ifdef DO_NOT_REDEFINE_MALLOC
#undef DO_NOT_REDEFINE_MALLOC
#endif
#endif
|