home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / smalltk / src / env.old < prev    next >
Text File  |  1991-10-12  |  4KB  |  192 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 LIGHTC
  98.         /* Macintosh using Lightspeed C compiler */
  99.         /* see install.ms for other changes */
  100.  
  101. typedef unsigned char byte;
  102.  
  103. # define byteToInt(b) (b)
  104.  
  105. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  106.  
  107. # define STRINGS
  108. # define BINREADWRITE
  109. # define STDWIN
  110. # define NOARGC
  111. # define PROTO
  112. # define NOSYSTEM
  113. # define obtalloc(x,y) (struct objectStruct *) calloc((unsigned) x, (unsigned) y)
  114.  
  115. # endif
  116.  
  117. # ifdef VMS 
  118.     /* VAX VMS */
  119.  
  120. typedef unsigned char byte;
  121.  
  122. # define byteToInt(b) (b)
  123.  
  124. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  125.  
  126. # define STRING
  127. # define NOARGC
  128.  
  129. # endif
  130.  
  131. /* ======== various defines that should work on all systems ==== */
  132.  
  133. # define streq(a,b) (strcmp(a,b) == 0)
  134.  
  135. # define true 1
  136. # define false 0
  137.  
  138.     /* define the datatype boolean */
  139. # ifdef NOTYPEDEF
  140. # define boolean int
  141. # endif
  142. # ifndef NOTYPEDEF
  143. typedef int boolean;
  144. # endif
  145.  
  146.     /* define a bit of lint silencing */
  147.     /*  ignore means ``i know this function returns something,
  148.         but I really, really do mean to ignore it */
  149. # ifdef NOVOID
  150. # define ignore
  151. # define noreturn
  152. # define void int
  153. # endif
  154. # ifndef NOVOID
  155. # define ignore (void)
  156. # define noreturn void
  157. # endif
  158.  
  159. /* prototypes are another problem.  If they are available, they should be
  160. used; but if they are not available their use will cause compiler errors.
  161. To get around this we define a lot of symbols which become nothing if
  162. prototypes aren't available */
  163. # ifdef PROTO
  164.  
  165. # define X ,
  166. # define OBJ object
  167. # define OBJP object *
  168. # define INT int
  169. # define BOOL boolean
  170. # define STR char *
  171. # define FLOAT double
  172. # define NOARGS void
  173. # define FILEP FILE *
  174. # define FUNC ()
  175.  
  176. # endif
  177.  
  178. # ifndef PROTO
  179.  
  180. # define X
  181. # define OBJ
  182. # define OBJP
  183. # define INT
  184. # define BOOL
  185. # define STR
  186. # define FLOAT
  187. # define NOARGS
  188. # define FILEP
  189. # define FUNC
  190.  
  191. # endif
  192.