home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cproto.zip / cproto46 / system.h < prev    next >
C/C++ Source or Header  |  1998-01-23  |  4KB  |  210 lines

  1. /* $Id: system.h,v 4.7 1998/01/24 01:42:09 cthuang Exp $
  2.  *
  3.  * cproto configuration and system dependencies
  4.  */
  5. #ifndef    SYSTEM_H
  6. #define    SYSTEM_H
  7.  
  8. #if !defined(TRUE) || (TRUE != 1)
  9. #undef  TRUE
  10. #define    TRUE    (1)
  11. #endif
  12.  
  13. #if !defined(FALSE) || (FALSE != 0)
  14. #undef  FALSE
  15. #define    FALSE    (0)
  16. #endif
  17.  
  18. /* Watcom C++ predefines __DOS__ when the target platform is MS-DOS */
  19. /* Borland C++ for MS-DOS predefines __MSDOS__ */
  20. #if defined(__DOS__) || defined(__MSDOS__)
  21. #ifndef MSDOS
  22. #define MSDOS
  23. #endif
  24. #endif
  25.  
  26. /* Watcom C++ predefines __OS2__ when the target platform is OS/2 */
  27. #ifdef __OS2__
  28. #ifndef OS2
  29. #define OS2
  30. #endif
  31. #endif
  32.  
  33. /* Watcom C++ predefines __NT__ when the target platform is Windows NT */
  34. #ifdef __NT__
  35. #ifndef WIN32
  36. #define WIN32
  37. #endif
  38. #endif
  39.  
  40. /* don't use continuation-lines -- breaks on VAXC */
  41. #if defined(__STDC__) || defined(__GNUC__) || defined(__WATCOMC__) || defined(vms)
  42. #define ARGS(p) p
  43. #else
  44. #define ARGS(p) ()
  45. #endif
  46.  
  47. /* Turbo C preprocessor */
  48. #ifdef __TURBOC__
  49. #define YY_READ_BUF_SIZE 256    /* patch */
  50. #define HAVE_TMPFILE 1
  51. #define HAVE_GETOPT_H 1    /* use the one from porting-directory */
  52. #include <io.h>        /* declares 'read()' for flex */
  53. #endif
  54.  
  55. #ifdef TURBO_CPP
  56. #define CPP "cpp -P-"
  57. #endif
  58.  
  59. /* EMX C preprocessor */
  60. #ifdef __EMX__
  61. #ifndef CPP
  62. #define CPP "cpp"
  63. #endif
  64. #endif
  65.  
  66. /* Watcom C preprocessor */
  67. #ifdef __WATCOMC__
  68. #ifndef CPP
  69. #define CPP "wcl386 /p"
  70. #endif
  71. #define HAVE_POPEN_PROTOTYPE 1
  72. #define popen _popen
  73. #define pclose _pclose
  74. #define HAVE_TMPFILE 1
  75. #endif
  76.  
  77. /* Microsoft C preprocessor */
  78. #ifdef M_I86
  79. #ifndef CPP
  80. #define CPP "cl /E /nologo"
  81. #endif
  82. #define HAVE_TMPFILE 1
  83. #endif
  84.  
  85. /* Vax C */
  86. #ifdef vms
  87. #ifndef CPP
  88. #define CPP "cc /preprocess_only=%s"
  89. #endif
  90. #define unlink remove
  91. #define HAVE_TMPFILE 1
  92. #define HAVE_GETOPT_H 1
  93. #define USE_flex 1
  94. #endif
  95.  
  96. /* Set configuration parameters for systems on which we cannot run autoconf.
  97.  * (Assumes Posix unless overridden).
  98.  */
  99. #ifndef HAVE_STDLIB_H
  100. #define HAVE_STDLIB_H 1
  101. #endif
  102.  
  103. #ifndef HAVE_STRING_H
  104. #define HAVE_STRING_H 1
  105. #endif
  106.  
  107. #ifndef HAVE_STRSTR
  108. #define HAVE_STRSTR 1
  109. #endif
  110.  
  111. #ifndef HAVE_GETOPT_H
  112. #define HAVE_GETOPT_H 0
  113. #endif 
  114.  
  115. /* Default C preprocessor on UNIX systems */
  116. #ifndef MSDOS
  117. #ifndef CPP
  118. #define CPP "/lib/cpp"
  119. #endif
  120. #endif
  121.  
  122. /* maximum include file nesting */
  123. #ifndef MAX_INC_DEPTH
  124. #define MAX_INC_DEPTH 15
  125. #endif
  126.  
  127. /* maximum number of include directories */
  128. #ifndef MAX_INC_DIR
  129. #define MAX_INC_DIR 15
  130. #endif
  131.  
  132. /* maximum text buffer size */
  133. #ifndef MAX_TEXT_SIZE
  134. #define MAX_TEXT_SIZE 256
  135. #endif
  136.  
  137. #if HAVE_STDLIB_H
  138. #include <stdlib.h>
  139. #else
  140. extern char *malloc  ARGS((size_t n));
  141. extern char *realloc ARGS((char *p, size_t n));
  142. #endif
  143.  
  144. /* Declare argument for exit() function */
  145. #ifdef vms
  146. #include <stsdef.h>
  147. #define    EXIT_SUCCESS    (STS$M_INHIB_MSG | STS$K_SUCCESS)
  148. #define    EXIT_FAILURE    (STS$M_INHIB_MSG | STS$K_ERROR)
  149. #else
  150. #ifndef EXIT_SUCCESS
  151. #define    EXIT_SUCCESS    (0)
  152. #endif
  153. #ifndef EXIT_FAILURE
  154. #define    EXIT_FAILURE    (1)
  155. #endif
  156. #endif /* vms */
  157.  
  158. #if HAVE_UNISTD_H
  159. #include <unistd.h>
  160. #endif
  161.  
  162. #if STDC_HEADERS || HAVE_STRING_H
  163. #  include <string.h>
  164. /* An ANSI string.h and pre-ANSI memory.h might conflict.  */
  165. #  if !STDC_HEADERS && HAVE_MEMORY_H
  166. #    include <memory.h>
  167. #  endif /* not STDC_HEADERS and HAVE_MEMORY_H */
  168. #else /* not STDC_HEADERS and not HAVE_STRING_H */
  169. #  include <strings.h>
  170. #  define strchr index
  171. #  define strrchr rindex
  172. /* memory.h and strings.h conflict on some systems.  */
  173. #endif /* not STDC_HEADERS and not HAVE_STRING_H */
  174.  
  175. extern char *getenv  ARGS((const char *v));
  176. extern char *strstr  ARGS((const char *s, const char *p));
  177.  
  178. /*
  179.  * The DOALLOC symbol controls whether we compile in the simple memory tests
  180.  * in 'trace.c' (use dbmalloc for more rigorous testing).
  181.  */
  182. #ifdef DOALLOC
  183. #include <trace.h>
  184. #endif /* DOALLOC */
  185.  
  186. /*
  187.  * Lint libraries are useful only on systems that are likely to have lint.
  188.  * The OPT_LINTLIBRARY symbol controls whether we compile in the lint library
  189.  * support.
  190.  */
  191. #ifndef OPT_LINTLIBRARY
  192. # if HAVE_PROG_LINT || defined(unix)
  193. #  define OPT_LINTLIBRARY 1
  194. # endif
  195. #endif
  196.  
  197. #if BISON_HAS_YYTNAME || YACC_HAS_YYTOKS || YACC_HAS_YYTOKS_2 || YACC_HAS_YYNAME
  198. # define YYDEBUG 1
  199. #endif
  200.  
  201. #if HAVE_LIBDMALLOC
  202. #include <dmalloc.h>    /* Gray Watson's library */
  203. #endif
  204.  
  205. #if HAVE_LIBDBMALLOC
  206. #include <dbmalloc.h>    /* Conor Cahill's library */
  207. #endif
  208.  
  209. #endif /* SYSTEM_H */
  210.