update credits
[LibreOffice.git] / rsc / source / rscpp / cppdef.h
bloba9ed59e43b44db15ff8196a9524d359c6c84b995
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 * This redundant definition of TRUE and FALSE works around
22 * a limitation of Decus C.
24 #ifndef TRUE
25 #define TRUE 1
26 #define FALSE 0
27 #endif
30 * Define the HOST operating system. This is needed so that
31 * cpp can use appropriate filename conventions.
33 #define SYS_UNKNOWN 0
34 #define SYS_UNIX 1
35 #define SYS_VMS 2
36 #define SYS_RSX 3
37 #define SYS_RT11 4
38 #define SYS_LATTICE 5
39 #define SYS_ONYX 6
40 #define SYS_68000 7
42 #ifndef HOST
43 #ifdef unix
44 #define HOST SYS_UNIX
45 #else
46 #ifdef vms
47 #define HOST SYS_VMS
48 #else
49 #ifdef rsx
50 #define HOST SYS_RSX
51 #else
52 #ifdef rt11
53 #define HOST SYS_RT11
54 #endif
55 #endif
56 #endif
57 #endif
58 #endif
60 #ifndef HOST
61 #define HOST SYS_UNKNOWN
62 #endif
65 * We assume that the target is the same as the host system
67 #ifndef TARGET
68 #define TARGET HOST
69 #endif
72 * In order to predefine machine-dependent constants,
73 * several strings are defined here:
75 * MACHINE defines the target cpu (by name)
76 * SYSTEM defines the target operating system
77 * COMPILER defines the target compiler
79 * The above may be #defined as "" if they are not wanted.
80 * They should not be #defined as NULL.
82 * LINE_PREFIX defines the # output line prefix, if not "line"
83 * This should be defined as "" if cpp is to replace
84 * the "standard" C pre-processor.
86 * FILE_LOCAL marks functions which are referenced only in the
87 * file they reside. Some C compilers allow these
88 * to be marked "static" even though they are referenced
89 * by "extern" statements elsewhere.
91 * OK_DOLLAR Should be set TRUE if $ is a valid alphabetic character
92 * in identifiers (default), or zero if $ is invalid.
93 * Default is TRUE.
95 * OK_CONCAT Should be set TRUE if # may be used to concatenate
96 * tokens in macros (per the Ansi Draft Standard) or
97 * FALSE for old-style # processing (needed if cpp is
98 * to process assembler source code).
100 * OK_DATE Predefines the compilation date if set TRUE.
101 * Not permitted by the Nov. 12, 1984 Draft Standard.
103 * S_CHAR etc. Define the sizeof the basic TARGET machine word types.
104 * By default, sizes are set to the values for the HOST
105 * computer. If this is inappropriate, see the code in
106 * cpp3.c for details on what to change. Also, if you
107 * have a machine where sizeof (signed int) differs from
108 * sizeof (unsigned int), you will have to edit code and
109 * tables in cpp3.c (and extend the -S option definition.)
111 * CPP_LIBRARY May be defined if you have a site-specific include directory
112 * which is to be searched *before* the operating-system
113 * specific directories.
116 #if TARGET == SYS_LATTICE
118 * We assume the operating system is pcdos for the IBM-PC.
119 * We also assume the small model (just like the PDP-11)
121 #define MACHINE "i8086"
122 #define SYSTEM "pcdos"
123 #endif
125 #if TARGET == SYS_ONYX
126 #define MACHINE "z8000"
127 #define SYSTEM "unix"
128 #endif
130 #if TARGET == SYS_VMS
131 #define MACHINE "vax"
132 #define SYSTEM "vms"
133 #define COMPILER "vax11c"
134 #endif
136 #if TARGET == SYS_RSX
137 #define MACHINE "pdp11"
138 #define SYSTEM "rsx"
139 #define COMPILER "decus"
140 #endif
142 #if TARGET == SYS_RT11
143 #define MACHINE "pdp11"
144 #define SYSTEM "rt11"
145 #define COMPILER "decus"
146 #endif
148 #if TARGET == SYS_68000 || defined(M68000) || defined(m68000) || defined(m68k)
150 * All three machine designators have been seen in various systems.
151 * Warning -- compilers differ as to sizeof (int). cpp3 assumes that
152 * sizeof (int) == 2
154 #define MACHINE "M68000", "m68000", "m68k"
155 #define SYSTEM "unix"
156 #endif
158 #if TARGET == SYS_UNIX
159 #define SYSTEM "unix"
160 #ifdef pdp11
161 #define MACHINE "pdp11"
162 #endif
163 #ifdef vax
164 #define MACHINE "vax"
165 #endif
166 #endif
169 * defaults
172 #ifndef MSG_PREFIX
173 #define MSG_PREFIX "cpp: "
174 #endif
176 #ifndef LINE_PREFIX
177 #define LINE_PREFIX ""
178 #endif
181 * OLD_PREPROCESSOR forces the definition of OK_DOLLAR, OK_CONCAT,
182 * COMMENT_INVISIBLE, and STRING_FORMAL to values appropriate for
183 * an old-style preprocessor.
186 #ifndef OLD_PREPROCESSOR
187 #define OLD_PREPROCESSOR FALSE
188 #endif
190 #if OLD_PREPROCESSOR
191 #define OK_DOLLAR FALSE
192 #define OK_CONCAT TRUE
193 #define COMMENT_INVISIBLE TRUE
194 #define STRING_FORMAL TRUE
195 #define IDMAX 63 /* actually, seems to be unlimited */
196 #endif
199 * RECURSION_LIMIT may be set to -1 to disable the macro recursion test.
201 #ifndef RECURSION_LIMIT
202 #define RECURSION_LIMIT 1000
203 #endif
206 * BITS_CHAR may be defined to set the number of bits per character.
207 * it is needed only for multi-byte character constants.
209 #ifndef BITS_CHAR
210 #define BITS_CHAR 8
211 #endif
214 * COMMENT_INVISIBLE may be defined to allow "old-style" comment
215 * processing, whereby the comment becomes a zero-length token
216 * delimiter. This permitted tokens to be concatenated in macro
217 * expansions. This was removed from the Draft Ansi Standard.
219 #ifndef COMMENT_INVISIBLE
220 #define COMMENT_INVISIBLE FALSE
221 #endif
224 * STRING_FORMAL may be defined to allow recognition of macro parameters
225 * anywhere in replacement strings. This was removed from the Draft Ansi
226 * Standard and a limited recognition capability added.
228 #ifndef STRING_FORMAL
229 #define STRING_FORMAL FALSE
230 #endif
233 * OK_DOLLAR enables use of $ as a valid "letter" in identifiers.
234 * This is a permitted extension to the Ansi Standard and is required
235 * for e.g., VMS, RSX-11M, etc. It should be set FALSE if cpp is
236 * used to preprocess assembler source on Unix systems. OLD_PREPROCESSOR
237 * sets OK_DOLLAR FALSE for that reason.
239 #ifndef OK_DOLLAR
240 #define OK_DOLLAR TRUE
241 #endif
244 * OK_CONCAT enables (one possible implementation of) token concatenation.
245 * If cpp is used to preprocess Unix assembler source, this should be
246 * set FALSE as the concatenation character, #, is used by the assembler.
248 #ifndef OK_CONCAT
249 #define OK_CONCAT TRUE
250 #endif
253 * OK_DATE may be enabled to predefine today's date as a string
254 * at the start of each compilation. This is apparently not permitted
255 * by the Draft Ansi Standard.
257 #ifndef OK_DATE
258 #define OK_DATE TRUE
259 #endif
262 * The following definitions are used to allocate memory for
263 * work buffers. In general, they should not be modified
264 * by implementors.
266 * PAR_MAC The maximum number of #define parameters (31 per Standard)
267 * Note: we need another one for strings.
268 * IDMAX The longest identifier, 31 per Ansi Standard
269 * NBUFF Input buffer size
270 * NWORK Work buffer size -- the longest macro
271 * must fit here after expansion.
272 * NEXP The nesting depth of #if expressions
273 * NINCLUDE The number of directories that may be specified
274 * on a per-system basis, or by the -I option.
275 * BLK_NEST The number of nested #if's permitted.
276 * NFWORK FileNameWorkBuffer (added by erAck, was NWORK)
279 #ifndef IDMAX
280 #define IDMAX 127
281 #endif
282 #ifdef SOLAR
283 #define PAR_MAC (253 + 1)
284 #else
285 #define PAR_MAC (31 + 1)
286 #endif
287 /* NWORK wg. grooossen Makros in *.src erhoeht,
288 da wir bald 10 Sprachen haben werden gleich ordentlich reingehauen.. */
289 #define NWORK 128000
290 #define NBUFF NWORK
291 #define NFWORK 1024
292 #define NEXP 128
293 #define NINCLUDE 100
294 #define NPARMWORK (NWORK * 2)
295 #define BLK_NEST 32
298 #ifndef ALERT
299 #ifdef EBCDIC
300 #define ALERT '\057'
301 #else
302 #define ALERT '\007' /* '\a' is "Bell" */
303 #endif
304 #endif
306 #ifndef VT
307 #define VT '\013' /* Vertical Tab CTRL/K */
308 #endif
311 #ifndef FILE_LOCAL
312 #ifdef decus
313 #define FILE_LOCAL static
314 #else
315 #ifdef vax11c
316 #define FILE_LOCAL static
317 #else
318 #define FILE_LOCAL /* Others are global */
319 #endif
320 #endif
321 #endif
323 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */