home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / smalltk / src / env.h < prev    next >
Text File  |  1991-10-12  |  4KB  |  194 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. #define TURBOC
  24.  
  25. /*=============== rules for various systems ====================*/
  26.  
  27. # ifdef B42
  28.   /* Berkeley 4.2, 4.3 and compatible running tty interface */
  29.     /*   which include: */
  30.     /* sequent balance */
  31.     /* Harris HCX-7 */
  32.     /* sun workstations */
  33.  
  34. typedef unsigned char byte;
  35.  
  36. # define byteToInt(b) (b)
  37.  
  38. /* this is a bit sloppy - but it works */
  39. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  40.  
  41. # define STRINGS
  42. # define SIGNAL
  43.  
  44. # endif
  45.  
  46. # ifdef SYSV
  47.   /* system V systems including: */
  48.   /*  HP-UX for the HP-9000 series */
  49.   /*  TEK 4404 with some modifications (see install.ms) */
  50.  
  51. typedef unsigned char byte;
  52.  
  53. # define byteToInt(b) (b)
  54.  
  55. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  56.  
  57. # define STRING
  58.  
  59. # endif
  60.  
  61. # ifdef TURBOC
  62.   /* IBM PC and compatiables using the TURBO C compiler */
  63.  
  64.   /* there are also changes that have to be made to the
  65.     smalltalk source; see installation notes for
  66.     details */
  67.  
  68. typedef unsigned char byte;
  69.  
  70. # define byteToInt(b) (b)
  71.  
  72. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  73.  
  74. # define STRING
  75. # define ALLOC
  76. # define BINREADWRITE
  77. # define CTRLBRK
  78. # define PROTO
  79. # define obtalloc(x,y) (struct objectStruct huge *) farcalloc((unsigned long) x, (unsigned long) y)
  80.  
  81. #endif
  82.  
  83. # ifdef ATARI
  84.   /* Atari st 1040 - still exprimental */
  85.  
  86. typedef unsigned char byte;
  87.  
  88. # define byteToInt(b) (b)
  89.  
  90. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  91.  
  92. # define STRING
  93. # define ALLOC
  94. # define BINREADWRITE
  95. # define obtalloc(x,y) (struct objectStruct *) calloc((unsigned) x, (unsigned) y)
  96.  
  97. #endif
  98.  
  99. # ifdef LIGHTC
  100.     /* Macintosh using Lightspeed C compiler */
  101.     /* see install.ms for other changes */
  102.  
  103. typedef unsigned char byte;
  104.  
  105. # define byteToInt(b) (b)
  106.  
  107. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  108.  
  109. # define STRINGS
  110. # define BINREADWRITE
  111. # define STDWIN
  112. # define NOARGC
  113. # define PROTO
  114. # define NOSYSTEM
  115. # define obtalloc(x,y) (struct objectStruct *) calloc((unsigned) x, (unsigned) y)
  116.  
  117. # endif
  118.  
  119. # ifdef VMS
  120.   /* VAX VMS */
  121.  
  122. typedef unsigned char byte;
  123.  
  124. # define byteToInt(b) (b)
  125.  
  126. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  127.  
  128. # define STRING
  129. # define NOARGC
  130.  
  131. # endif
  132.  
  133. /* ======== various defines that should work on all systems ==== */
  134.  
  135. # define streq(a,b) (strcmp(a,b) == 0)
  136.  
  137. # define true 1
  138. # define false 0
  139.  
  140.   /* define the datatype boolean */
  141. # ifdef NOTYPEDEF
  142. # define boolean int
  143. # endif
  144. # ifndef NOTYPEDEF
  145. typedef int boolean;
  146. # endif
  147.  
  148.   /* define a bit of lint silencing */
  149.   /*  ignore means ``i know this function returns something,
  150.     but I really, really do mean to ignore it */
  151. # ifdef NOVOID
  152. # define ignore
  153. # define noreturn
  154. # define void int
  155. # endif
  156. # ifndef NOVOID
  157. # define ignore (void)
  158. # define noreturn void
  159. # endif
  160.  
  161. /* prototypes are another problem.  If they are available, they should be
  162. used; but if they are not available their use will cause compiler errors.
  163. To get around this we define a lot of symbols which become nothing if
  164. prototypes aren't available */
  165. # ifdef PROTO
  166.  
  167. # define X ,
  168. # define OBJ object
  169. # define OBJP object *
  170. # define INT int
  171. # define BOOL boolean
  172. # define STR char *
  173. # define FLOAT double
  174. # define NOARGS void
  175. # define FILEP FILE *
  176. # define FUNC ()
  177.  
  178. # endif
  179.  
  180. # ifndef PROTO
  181.  
  182. # define X
  183. # define OBJ
  184. # define OBJP
  185. # define INT
  186. # define BOOL
  187. # define STR
  188. # define FLOAT
  189. # define NOARGS
  190. # define FILEP
  191. # define FUNC
  192.  
  193. # endif
  194.