home *** CD-ROM | disk | FTP | other *** search
/ BURKS 2 / BURKS_AUG97.ISO / BURKS / SOFTWARE / SOURCES / MAWK11AS.ZIP / CONFIG / IDEFAULT.H (.txt) < prev    next >
C/C++ Source or Header  |  1991-12-18  |  6KB  |  295 lines

  1.  
  2. /********************************************
  3. Idefault.h
  4. copyright 1991, Michael D. Brennan
  5.  
  6. This is a source file for mawk, an implementation of
  7. the AWK programming language.
  8.  
  9. Mawk is distributed without warranty under the terms of
  10. the GNU General Public License, version 2, 1991.
  11. ********************************************/
  12.  
  13.  
  14. /* $Log:    Idefault.h,v $
  15.  * Revision 3.12  91/11/16  15:37:29  brennan
  16.  * add NO_BINMODE
  17.  * 
  18.  * Revision 3.11  91/10/29  10:48:40  brennan
  19.  * version 1.09
  20.  * 
  21.  * Revision 3.10  91/10/23  10:46:34  brennan
  22.  * MSDOS LM and SM
  23.  * 
  24.  * Revision 3.9  91/10/14  09:52:48  brennan
  25.  * added HAVE_PRINTF_HD
  26.  * 
  27.  * Revision 3.8  91/09/30  08:11:22  brennan
  28.  * added MAX__INT
  29.  * 
  30.  * Revision 3.7  91/08/16  08:49:51  brennan
  31.  * Carl's addition of SW_FP_CHECK for XNX23A
  32.  * 
  33.  * Revision 3.6  91/08/13  09:04:05  brennan
  34.  * VERSION .9994
  35.  * 
  36.  * Revision 3.5  91/08/03  06:10:46  brennan
  37.  * changed CHECK_DIVZERO macro
  38.  * 
  39.  * Revision 3.4  91/08/03  05:35:59  brennan
  40.  * changed name to Idefault.h 
  41.  * 
  42.  * Revision 3.3  91/06/28  04:36:28  brennan
  43.  * adjustments with __STDC__
  44.  * 
  45.  * Revision 3.3  91/06/19  10:21:37  brennan
  46.  * changes for xenix_r2.h and gcc
  47.  * 
  48.  * Revision 3.2  91/06/15  09:24:34  brennan
  49.  * Carl's diffs for V7
  50.  * 
  51.  * 06/11/91  C. Mascott        add default D2BOOL
  52.  *
  53.  * Revision 3.1  91/06/07  10:38:46  brennan
  54.  * VERSION 0.995
  55.  * 
  56. */
  57.  
  58. /* The most common configuration is defined here:
  59.  
  60.    no function prototypes
  61.    have void*
  62.    have matherr(), strtod(), fmod()
  63.    uses <varargs.h>
  64.  
  65.    fpe_traps default to off
  66.    and nan comparison is done correctly
  67.  
  68.    memory is not small
  69.  
  70.    OS is some flavor of Unix
  71.  
  72. */
  73.  
  74. /* WARNING:  To port to a new configuration, don't make changes
  75.    here.  This file is included at the end of your new 
  76.    config.h 
  77.  
  78.    Read the file   mawk/INSTALL
  79. */
  80.  
  81.  
  82. /*------------- compiler ----------------------------*/
  83. /* do not have function prototypes */
  84.  
  85. #ifndef  HAVE_PROTOS
  86. #define  HAVE_PROTOS        0
  87. #endif
  88.  
  89. /* have type   void *    */
  90. #ifndef  HAVE_VOID_PTR
  91. #define  HAVE_VOID_PTR        1
  92. #endif
  93.  
  94. /* logical test of double is OK */
  95. #ifndef D2BOOL
  96. #define D2BOOL(x)        (x)
  97. #endif
  98.  
  99. /*---------------- library ----------------------*/
  100.  
  101.  
  102. #ifndef  HAVE_MATHERR
  103. #define  HAVE_MATHERR        1
  104. #endif
  105.  
  106. #ifndef  HAVE_STRTOD
  107. #define  HAVE_STRTOD        1
  108. #endif
  109.  
  110. #ifndef  HAVE_FMOD
  111. #define  HAVE_FMOD        1
  112. #endif
  113.  
  114. /* uses <varargs.h> instead of <stdarg.h> */
  115. #ifndef  HAVE_STDARG_H    
  116. #define  HAVE_STDARG_H        0
  117. #endif
  118.  
  119. /* has <string.h>, 
  120.    doesn't have <stdlib.h>  
  121.    has <fcntl.h>
  122. */
  123.  
  124. #ifndef  HAVE_STRING_H
  125. #define  HAVE_STRING_H        1
  126. #endif
  127.  
  128. #ifndef  HAVE_STDLIB_H
  129. #define  HAVE_STDLIB_H        0
  130. #endif
  131.  
  132. #ifndef  HAVE_FCNTL_H
  133. #define  HAVE_FCNTL_H        1
  134. #endif
  135.  
  136. /* printf and sprintf don't recognize "%hd" */
  137. #ifndef  HAVE_PRINTF_HD
  138. #define  HAVE_PRINTF_HD        0
  139. #endif
  140.  
  141. /* have pipes */
  142. #ifndef  HAVE_REAL_PIPES
  143. #define  HAVE_REAL_PIPES    1
  144. #endif
  145.  
  146. #ifndef  HAVE_FAKE_PIPES    
  147. #define  HAVE_FAKE_PIPES    0
  148. #endif
  149.  
  150. /*------------- machine ------------------------*/
  151.  
  152. /* ints are 32bits, two complement */
  153. #ifndef  MAX__INT     
  154. #define  MAX__INT    0x7fffffff
  155. #endif
  156.  
  157. /* default is IEEE754 and data space is not scarce */
  158.  
  159. #ifndef  FPE_TRAPS_ON
  160. #define  FPE_TRAPS_ON        0
  161. #endif
  162.  
  163. #ifndef   NOINFO_SIGFPE
  164. #define   NOINFO_SIGFPE        0
  165. #endif
  166.  
  167. #if   ! FPE_TRAPS_ON
  168. #undef   NOINFO_SIGFPE  
  169. #define  NOINFO_SIGFPE          0 /* make sure no one does
  170.                      something stupid */
  171. #endif
  172.  
  173.  
  174. #if      NOINFO_SIGFPE
  175. #define  CHECK_DIVZERO(x)    if( (x) == 0.0 )rt_error(dz_msg);else
  176. #endif
  177.  
  178. /* SW_FP_CHECK is specific to V7 and XNX23A
  179.     (1) is part of STDC_MATHERR def.
  180.     (2) enables calls to XENIX-68K 2.3A clrerr(), iserr()
  181.  */
  182. #ifndef  SW_FP_CHECK
  183. #define  SW_FP_CHECK        0
  184. #endif
  185.  
  186. #ifndef  TURN_OFF_FPE_TRAPS
  187. #define  TURN_OFF_FPE_TRAPS()    /* nothing */
  188. #endif
  189.  
  190. #ifndef  HAVE_SMALL_MEMORY
  191. #define  HAVE_SMALL_MEMORY    0
  192. #endif
  193.  
  194.  
  195. /*------------------------------------------------*/
  196.  
  197.  
  198. #ifndef  __STDC__
  199. #define  __STDC__  0
  200. #endif
  201.  
  202. #if   __STDC__  
  203.  
  204. #undef  HAVE_PROTOS
  205. #define HAVE_PROTOS        1
  206. #undef  HAVE_VOID_PTR
  207. #define HAVE_VOID_PTR        1
  208. #undef  HAVE_STDARG_H
  209. #define HAVE_STDARG_H        1
  210. #undef  HAVE_STRING_H
  211. #define HAVE_STRING_H        1
  212. #endif  
  213.  
  214. #if   __STDC__  &&  ! __GNUC__
  215. /* with gcc __STDC__ can be defined, but stdlib.h is missing */
  216. #undef  HAVE_STDLIB_H
  217. #define HAVE_STDLIB_H        1
  218. #endif
  219.  
  220.  
  221.  
  222.  
  223. /* the painfull case: we need to catch fpe's and look at errno
  224.    after lib calls */
  225.  
  226. #define  STDC_MATHERR    ((SW_FP_CHECK || FPE_TRAPS_ON) && HAVE_MATHERR==0)
  227.  
  228. /*-------------------MSDOS---------------------------------*/
  229.  
  230. #ifdef    MSDOS
  231.  
  232. #ifndef  HAVE_REARGV
  233. #define  HAVE_REARGV    0
  234. #endif
  235.  
  236. #undef   MAX__INT
  237. #define  MAX__INT    0x7fff
  238.  
  239. #if  HAVE_SMALL_MEMORY==0
  240. #define  LM_DOS        1
  241. #else
  242. #define  LM_DOS        0
  243. #endif
  244.  
  245. #define   SM_DOS    (!LM_DOS)
  246.  
  247. #undef  HAVE_REAL_PIPES
  248. #define HAVE_REAL_PIPES        0
  249. #undef  HAVE_FAKE_PIPES
  250. #define HAVE_FAKE_PIPES        1
  251.  
  252. #if  SM_DOS 
  253. #ifdef  NO_BINMODE
  254. #undef  NO_BINMODE
  255. #define NO_BINMODE    1   /* hopefully no one needs this */
  256. #else
  257. #define NO_BINMODE    0
  258. #endif
  259. #else 
  260. #define NO_BINMODE    0
  261. #endif /* SM_DOS */
  262.  
  263. #else /* not defined MSDOS */
  264. #define   MSDOS        0
  265. #define   LM_DOS    0
  266. #define   SM_DOS    0
  267.  
  268. #endif /* MSDOS */
  269.  
  270. /*----------------------------------------------------------*/
  271.  
  272.  
  273. #if  HAVE_PROTOS
  274. #define  PROTO(name, args)  name  args
  275. #else
  276. #define  PROTO(name, args)  name()
  277. #endif
  278.  
  279. /* ultrix pukes if __STDC__ is defined 0  */
  280. /* SCO UNIX's cc (from Microsoft) sneezes if __STDC__ is re-#define-d */
  281. #if (__STDC__ == 0)
  282. #ifndef M_I386
  283. #undef __STDC__
  284. #endif
  285. #endif
  286.  
  287. /* for Think C on the Macintosh, sizeof(size_t) != sizeof(unsigned
  288.  * Rather than unilaterally imposing size_t, when not all compilers would
  289.  * necessarily have it defined, we use the SIZE_T() macro where appropriate
  290.  * to typecast function arguments
  291.  */
  292. #ifndef SIZE_T
  293. #define SIZE_T(x) (x)
  294. #endif
  295.