cppdef.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  1. /******************************************************************************
  2. * FREXXWARE
  3. * ----------------------------------------------------------------------------
  4. *
  5. * Project: Frexx C Preprocessor
  6. * $Source: /home/user/start/cpp/RCS/cppdef.h,v $
  7. * $Revision: 1.4 $
  8. * $Date: 1993/12/06 13:51:20 $
  9. * $Author: start $
  10. * $State: Exp $
  11. * $Locker: start $
  12. *
  13. * ----------------------------------------------------------------------------
  14. * $Log: cppdef.h,v $
  15. * Revision 1.4 1993/12/06 13:51:20 start
  16. * A lot of new stuff (too much to mention)
  17. *
  18. * Revision 1.3 1993/11/29 14:01:13 start
  19. * New features added
  20. *
  21. * Revision 1.2 1993/11/11 07:16:39 start
  22. * New stuff
  23. *
  24. * Revision 1.1 1993/11/03 09:15:59 start
  25. * Initial revision
  26. *
  27. *
  28. *****************************************************************************/
  29. #ifdef EMACS
  30. /* Use the Emacs config file to find out what type of machine */
  31. #define NO_SHORTNAMES
  32. /* Convert Emacs's conventions for BIG_ENDIAN to cpp's convention. */
  33. #ifdef BIG_ENDIAN
  34. #undef BIG_ENDIAN
  35. #define BIG_ENDIAN FPP_TRUE
  36. #else /* not BIG_ENDIAN */
  37. #define BIG_ENDIAN FPP_FALSE
  38. #endif /* BIG_ENDIAN */
  39. /* Emacs uses the names index and rindex and defines them as str(r)chr if nec;
  40. cpp uses the opposite convention. Here we flush the macro definitions for
  41. Emacs and add the ones cpp wants. */
  42. #ifdef index
  43. #undef index
  44. #undef rindex
  45. #else /* index is not defined as a macro */
  46. #define strchr index
  47. #define strrchr rindex
  48. #endif /* index is not defined as a macro */
  49. #define NBUFF 2048
  50. #define NWORK 2048
  51. #endif /* EMACS */
  52. /*
  53. * S y s t e m D e p e n d e n t
  54. * D e f i n i t i o n s f o r C P P
  55. *
  56. * Definitions in this file may be edited to configure CPP for particular
  57. * host operating systems and target configurations.
  58. *
  59. * NOTE: cpp assumes it is compiled by a compiler that supports macros
  60. * with arguments. If this is not the case (as for Decus C), #define
  61. * nomacarg -- and provide function equivalents for all macros.
  62. *
  63. * cpp also assumes the host and target implement the Ascii character set.
  64. * If this is not the case, you will have to do some editing here and there.
  65. */
  66. /*
  67. * This redundant definition of FPP_TRUE and FPP_FALSE works around
  68. * a limitation of Decus C.
  69. */
  70. #ifndef FPP_TRUE
  71. #define FPP_TRUE 1
  72. #define FPP_FALSE 0
  73. #endif
  74. /*
  75. * Define the HOST operating system. This is needed so that
  76. * cpp can use appropriate filename conventions.
  77. */
  78. #define SYS_UNKNOWN 0
  79. #define SYS_UNIX 1
  80. #define SYS_VMS 2
  81. #define SYS_RSX 3
  82. #define SYS_RT11 4
  83. #define SYS_LATTICE 5
  84. #define SYS_ONYX 6
  85. #define SYS_68000 7
  86. #define SYS_AMIGADOS 8
  87. #ifndef HOST
  88. #ifdef unix
  89. #define HOST SYS_UNIX
  90. #else
  91. #ifdef amiga
  92. #define HOST SYS_AMIGADOS
  93. #endif
  94. #endif
  95. #endif
  96. /*
  97. * We assume that the target is the same as the host system
  98. */
  99. #ifndef TARGET
  100. #define TARGET HOST
  101. #endif
  102. /*
  103. * In order to predefine machine-dependent constants,
  104. * several strings are defined here:
  105. *
  106. * MACHINE defines the target cpu (by name)
  107. * SYSTEM defines the target operating system
  108. * COMPILER defines the target compiler
  109. *
  110. * The above may be #defined as "" if they are not wanted.
  111. * They should not be #defined as NULL.
  112. *
  113. * LINE_PREFIX defines the # output line prefix, if not "line"
  114. * This should be defined as "" if cpp is to replace
  115. * the "standard" C pre-processor.
  116. */
  117. #define LINE_PREFIX "line"
  118. /*
  119. * FILE_LOCAL marks functions which are referenced only in the
  120. * file they reside. Some C compilers allow these
  121. * to be marked "static" even though they are referenced
  122. * by "extern" statements elsewhere.
  123. *
  124. * OK_DOLLAR Should be set FPP_TRUE if $ is a valid alphabetic character
  125. * in identifiers (default), or zero if $ is invalid.
  126. * Default is FPP_TRUE.
  127. *
  128. * OK_CONCAT Should be set FPP_TRUE if # may be used to concatenate
  129. * tokens in macros (per the Ansi Draft Standard) or
  130. * FPP_FALSE for old-style # processing (needed if cpp is
  131. * to process assembler source code).
  132. */
  133. #define OK_CONCAT FPP_TRUE
  134. /*
  135. * OK_DATE Predefines the compilation date if set FPP_TRUE.
  136. * Not permitted by the Nov. 12, 1984 Draft Standard.
  137. */
  138. #define OK_DATE FPP_TRUE
  139. /*
  140. *
  141. * OK_SIZEOF Permits sizeof in #if preprocessor expressions.
  142. * According to K&R V2 (page 232), this is not allowed.
  143. */
  144. #define OK_SIZEOF FPP_TRUE
  145. /*
  146. * S_CHAR etc. Define the sizeof the basic TARGET machine word types.
  147. * By default, sizes are set to the values for the HOST
  148. * computer. If this is inappropriate, see the code in
  149. * cpp3.c for details on what to change. Also, if you
  150. * have a machine where sizeof (signed int) differs from
  151. * sizeof (unsigned int), you will have to edit code and
  152. * tables in cpp3.c (and extend the -S option definition.)
  153. *
  154. * CPP_LIBRARY May be defined if you have a site-specific include directory
  155. * which is to be searched *before* the operating-system
  156. * specific directories.
  157. */
  158. #define MACHINE "amiga", "m68000"
  159. #define SYSTEM "amigados"
  160. /*
  161. * defaults
  162. */
  163. #ifndef MSG_PREFIX
  164. #define MSG_PREFIX "cpp: "
  165. #endif
  166. /*
  167. * OLD_PREPROCESSOR forces the definition of OK_DOLLAR, OK_CONCAT,
  168. * COMMENT_INVISIBLE to values appropriate for
  169. * an old-style preprocessor.
  170. */
  171. #if OLD_PREPROCESSOR
  172. #define OK_DOLLAR FPP_FALSE
  173. #define OK_CONCAT FPP_FALSE
  174. #define COMMENT_INVISIBLE FPP_TRUE
  175. #endif
  176. /*
  177. * RECURSION_LIMIT may be set to -1 to disable the macro recursion test.
  178. */
  179. #ifndef RECURSION_LIMIT
  180. #define RECURSION_LIMIT 1000
  181. #endif
  182. /*
  183. * BITS_CHAR may be defined to set the number of bits per character.
  184. * it is needed only for multi-byte character constants.
  185. */
  186. #ifndef BITS_CHAR
  187. #define BITS_CHAR 8
  188. #endif
  189. /*
  190. * BIG_ENDIAN is set FPP_TRUE on machines (such as the IBM 360 series)
  191. * where 'ab' stores 'a' in the high-bits and 'b' in the low-bits.
  192. * It is set FPP_FALSE on machines (such as the PDP-11 and Vax-11)
  193. * where 'ab' stores 'a' in the low-bits and 'b' in the high-bits.
  194. * (Or is it the other way around?) -- Warning: BIG_ENDIAN code is untested.
  195. * [I *seems* to be the other way around, according to the code /OIS]
  196. */
  197. #ifndef BIG_ENDIAN
  198. #define BIG_ENDIAN FPP_FALSE
  199. #endif
  200. /*
  201. * COMMENT_INVISIBLE may be defined to allow "old-style" comment
  202. * processing, whereby the comment becomes a zero-length token
  203. * delimiter. This permitted tokens to be concatenated in macro
  204. * expansions. This was removed from the Draft Ansi Standard.
  205. */
  206. #ifndef COMMENT_INVISIBLE
  207. #define COMMENT_INVISIBLE FPP_FALSE
  208. #endif
  209. /*
  210. * OK_DOLLAR enables use of $ as a valid "letter" in identifiers.
  211. * This is a permitted extension to the Ansi Standard and is required
  212. * for e.g., VMS, RSX-11M, etc. It should be set FPP_FALSE if cpp is
  213. * used to preprocess assembler source on Unix systems. OLD_PREPROCESSOR
  214. * sets OK_DOLLAR FPP_FALSE for that reason.
  215. */
  216. #ifndef OK_DOLLAR
  217. #define OK_DOLLAR FPP_TRUE
  218. #endif
  219. /*
  220. * OK_CONCAT enables (one possible implementation of) token concatenation.
  221. * If cpp is used to preprocess Unix assembler source, this should be
  222. * set FPP_FALSE as the concatenation character, #, is used by the assembler.
  223. */
  224. #ifndef OK_CONCAT
  225. #define OK_CONCAT FPP_TRUE
  226. #endif
  227. /*
  228. * OK_DATE may be enabled to predefine today's date as a string
  229. * at the start of each compilation. This is apparently not permitted
  230. * by the Draft Ansi Standard.
  231. */
  232. #ifndef OK_DATE
  233. #define OK_DATE FPP_TRUE
  234. #endif
  235. /*
  236. * OK_SIZEOF may be defined to allow sizeof(type) in #if expressions.
  237. * Actually, it is none of the preprocessors business how large these
  238. * things are, as they might be different with different compiler
  239. * options. Also, according to K&R V2, page 232, it is nonstandard.
  240. * This option was added in the PDC process, under no. *OIS*0.92*.
  241. */
  242. #ifndef OK_SIZEOF
  243. #define OK_SIZEOF FPP_FALSE
  244. #endif
  245. /*
  246. * Some common definitions.
  247. */
  248. #ifndef DEBUG
  249. #define DEBUG FPP_FALSE
  250. #endif
  251. /*
  252. * The following definitions are used to allocate memory for
  253. * work buffers. In general, they should not be modified
  254. * by implementors.
  255. *
  256. * PAR_MAC The maximum number of #define parameters (31 per Standard)
  257. * Note: we need another one for strings.
  258. * NBUFF Input buffer size
  259. * NWORK Work buffer size -- the longest macro
  260. * must fit here after expansion.
  261. * NEXP The nesting depth of #if expressions
  262. * NINCLUDE The number of directories that may be specified
  263. * on a per-system basis, or by the -I option.
  264. * BLK_NEST The number of nested #if's permitted.
  265. */
  266. #ifndef PAR_MAC
  267. #define PAR_MAC (31 + 1)
  268. #endif
  269. #ifndef NBUFF
  270. #define NBUFF 512
  271. #endif
  272. #ifndef NWORK
  273. #define NWORK 512
  274. #endif
  275. #ifndef NEXP
  276. #define NEXP 128
  277. #endif
  278. #ifndef NINCLUDE
  279. #define NINCLUDE 20
  280. #endif
  281. #ifndef NPARMWORK
  282. #define NPARMWORK (NWORK * 2)
  283. #endif
  284. #ifndef BLK_NEST
  285. #define BLK_NEST 32
  286. #endif
  287. /*
  288. * Some special constants. These may need to be changed if cpp
  289. * is ported to a wierd machine.
  290. *
  291. * NOTE: if cpp is run on a non-ascii machine, ALERT and VT may
  292. * need to be changed. They are used to implement the proposed
  293. * ANSI standard C control characters '\a' and '\v' only.
  294. * DEL is used to tag macro tokens to prevent #define foo foo
  295. * from looping. Note that we don't try to prevent more elaborate
  296. * #define loops from occurring.
  297. */
  298. #ifndef ALERT
  299. #define ALERT '\007' /* '\a' is "Bell" */
  300. #endif
  301. #ifndef VT
  302. #define VT '\013' /* Vertical Tab CTRL/K */
  303. #endif
  304. /*
  305. * Functions can be declared/defined static to only become in the
  306. * scope for functions of the same source file.
  307. */
  308. #ifndef FILE_LOCAL
  309. #define FILE_LOCAL static /* file-unique globals */
  310. #endif
  311. /*
  312. * For compilers supporting inlining, the INLINE macro has been added to
  313. * functions called from only one place. There might still be some
  314. * functions that should have this macro.
  315. */
  316. #ifdef AMIGA
  317. #define INLINE __inline /* Amiga compiler SAS/C 6.x supports this! */
  318. #else
  319. #define INLINE /* don't support that kind of stuff */
  320. #endif
  321. #if defined(AMIGA) && defined(SHARED)
  322. #define PREFIX __asm __saveds
  323. #define REG(x) register __ ## x
  324. #else
  325. #define PREFIX
  326. #define REG(x)
  327. #endif
  328. /*
  329. * SBSIZE defines the number of hash-table slots for the symbol table.
  330. */
  331. #ifndef SBSIZE
  332. #define SBSIZE 64
  333. #endif
  334. #define VERSION_TEXT "Frexx C Preprocessor v1.5.1 " \
  335. "Copyright (C) by FrexxWare 1993 - 2002.\n" \
  336. "Compiled " __DATE__ "\n"