home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / dev / alst-3.04.lha / ALSt-3.04 / src / env.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-14  |  4.5 KB  |  224 lines

  1. /*
  2.     Little Smalltalk, version two
  3.     Written by Tim Budd, Oregon State University, July 1987
  4.  
  5.     environmental factors
  6.  
  7.     This include file gathers together environmental factors that
  8.     are likely to change from one C compiler to another, or from
  9.     one system to another.  Please refer to the installation 
  10.     notes for more information.
  11.  
  12.     for systems using the Make utility, the system name is set
  13.     by the make script.
  14.     other systems (such as the Mac) should put a define statement
  15.     at the beginning of the file, as shown below
  16. */
  17.  
  18. /*
  19. systems that don't use the Make utility should do something like this:
  20. # define LIGHTC
  21. */
  22.  
  23. /*=============== rules for various systems ====================*/
  24.  
  25. # ifdef B42
  26.     /* Berkeley 4.2, 4.3 and compatible running tty interface */
  27.         /*   which include: */
  28.         /* sequent balance */
  29.         /* Harris HCX-7 */
  30.         /* sun workstations */
  31.  
  32. typedef unsigned char byte;
  33.  
  34. # define byteToInt(b) (b)
  35.  
  36. /* this is a bit sloppy - but it works */
  37. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  38.  
  39. # define STRINGS
  40. # define SIGNAL
  41.  
  42. # endif
  43.  
  44. # ifdef SYSV
  45.     /* system V systems including: */
  46.     /*    HP-UX for the HP-9000 series */
  47.     /*     TEK 4404 with some modifications (see install.ms) */
  48.  
  49. typedef unsigned char byte;
  50.  
  51. # define byteToInt(b) (b)
  52.  
  53. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  54.  
  55. # define STRING
  56.  
  57. # endif
  58.  
  59. # ifdef TURBOC
  60.     /* IBM PC and compatiables using the TURBO C compiler */
  61.     
  62.     /* there are also changes that have to be made to the 
  63.         smalltalk source; see installation notes for
  64.         details */
  65.  
  66. typedef unsigned char byte;
  67.  
  68. # define byteToInt(b) (b)
  69.  
  70. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  71.  
  72. # define STRING
  73. # define ALLOC
  74. # define BINREADWRITE
  75. # define CTRLBRK
  76. # define PROTO
  77. # define obtalloc(x,y) (struct objectStruct huge *) farcalloc((unsigned long) x, (unsigned long) y)
  78.  
  79. #endif
  80.  
  81. # ifdef ATARI
  82.     /* Atari st 1040 - still exprimental */
  83.     
  84. typedef unsigned char byte;
  85.  
  86. # define byteToInt(b) (b)
  87.  
  88. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  89.  
  90. # define STRING
  91. # define ALLOC
  92. # define BINREADWRITE
  93. # define obtalloc(x,y) (struct objectStruct *) calloc((unsigned) x, (unsigned) y)
  94.  
  95. #endif
  96.  
  97. # ifdef AZTEC_C
  98.     /* Amiga w/Manx Aztec C 5.2a - still exprimental */
  99.     
  100. typedef unsigned char byte;
  101.  
  102. # define byteToInt(b) (b)
  103.  
  104. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  105.  
  106. # define STRING
  107. # define BINREADWRITE
  108. # define obtalloc(x,y) (struct objectStruct *) calloc((unsigned) x, (unsigned) y)
  109. # define system(x) Execute(x, 0L, 0L)
  110.  
  111. #endif
  112.  
  113. # ifdef AMIGA
  114.     /* Amiga w/GNU C 2.5.8 - still exprimental */
  115.     
  116. typedef unsigned char byte;
  117.  
  118. # define byteToInt(b) (b)
  119.  
  120. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  121.  
  122. # define STRING
  123. # define BINREADWRITE
  124. # define obtalloc(x,y) (struct objectStruct *) calloc((unsigned) x, (unsigned) y)
  125. # define system(x) Execute(x, 0L, 0L)
  126.  
  127. #endif
  128.  
  129. # ifdef LIGHTC
  130.         /* Macintosh using Lightspeed C compiler */
  131.         /* see install.ms for other changes */
  132.  
  133. typedef unsigned char byte;
  134.  
  135. # define byteToInt(b) (b)
  136.  
  137. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  138.  
  139. # define STRINGS
  140. # define BINREADWRITE
  141. # define STDWIN
  142. # define NOARGC
  143. # define PROTO
  144. # define NOSYSTEM
  145. # define obtalloc(x,y) (struct objectStruct *) calloc((unsigned) x, (unsigned) y)
  146.  
  147. # endif
  148.  
  149. # ifdef VMS 
  150.     /* VAX VMS */
  151.  
  152. typedef unsigned char byte;
  153.  
  154. # define byteToInt(b) (b)
  155.  
  156. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  157.  
  158. # define STRING
  159. # define NOARGC
  160.  
  161. # endif
  162.  
  163. /* ======== various defines that should work on all systems ==== */
  164.  
  165. # define streq(a,b) (strcmp(a,b) == 0)
  166.  
  167. # define true 1
  168. # define false 0
  169.  
  170.     /* define the datatype boolean */
  171. # ifdef NOTYPEDEF
  172. # define boolean int
  173. # endif
  174. # ifndef NOTYPEDEF
  175. typedef int boolean;
  176. # endif
  177.  
  178.     /* define a bit of lint silencing */
  179.     /*  ignore means ``i know this function returns something,
  180.         but I really, really do mean to ignore it */
  181. # ifdef NOVOID
  182. # define ignore
  183. # define noreturn
  184. # define void int
  185. # endif
  186. # ifndef NOVOID
  187. # define ignore (void)
  188. # define noreturn void
  189. # endif
  190.  
  191. /* prototypes are another problem.  If they are available, they should be
  192. used; but if they are not available their use will cause compiler errors.
  193. To get around this we define a lot of symbols which become nothing if
  194. prototypes aren't available */
  195. # ifdef PROTO
  196.  
  197. # define X ,
  198. # define OBJ object
  199. # define OBJP object *
  200. # define INT int
  201. # define BOOL boolean
  202. # define STR char *
  203. # define FLOAT double
  204. # define NOARGS void
  205. # define FILEP FILE *
  206. # define FUNC ()
  207.  
  208. # endif
  209.  
  210. # ifndef PROTO
  211.  
  212. # define X
  213. # define OBJ
  214. # define OBJP
  215. # define INT
  216. # define BOOL
  217. # define STR
  218. # define FLOAT
  219. # define NOARGS
  220. # define FILEP
  221. # define FUNC
  222.  
  223. # endif
  224.