Update ooo320-m1
[ooovba.git] / rsc / source / rscpp / cppdef.h
blob79bbd89cf462ef6a5f8119e9aa8c45492dc0fe45
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: cppdef.h,v $
10 * $Revision: 1.9 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
32 * This redundant definition of TRUE and FALSE works around
33 * a limitation of Decus C.
35 #ifndef TRUE
36 #define TRUE 1
37 #define FALSE 0
38 #endif
41 * Define the HOST operating system. This is needed so that
42 * cpp can use appropriate filename conventions.
44 #define SYS_UNKNOWN 0
45 #define SYS_UNIX 1
46 #define SYS_VMS 2
47 #define SYS_RSX 3
48 #define SYS_RT11 4
49 #define SYS_LATTICE 5
50 #define SYS_ONYX 6
51 #define SYS_68000 7
53 #ifndef HOST
54 #ifdef unix
55 #define HOST SYS_UNIX
56 #else
57 #ifdef vms
58 #define HOST SYS_VMS
59 #else
60 #ifdef rsx
61 #define HOST SYS_RSX
62 #else
63 #ifdef rt11
64 #define HOST SYS_RT11
65 #endif
66 #endif
67 #endif
68 #endif
69 #endif
71 #ifndef HOST
72 #define HOST SYS_UNKNOWN
73 #endif
76 * We assume that the target is the same as the host system
78 #ifndef TARGET
79 #define TARGET HOST
80 #endif
83 * In order to predefine machine-dependent constants,
84 * several strings are defined here:
86 * MACHINE defines the target cpu (by name)
87 * SYSTEM defines the target operating system
88 * COMPILER defines the target compiler
90 * The above may be #defined as "" if they are not wanted.
91 * They should not be #defined as NULL.
93 * LINE_PREFIX defines the # output line prefix, if not "line"
94 * This should be defined as "" if cpp is to replace
95 * the "standard" C pre-processor.
97 * FILE_LOCAL marks functions which are referenced only in the
98 * file they reside. Some C compilers allow these
99 * to be marked "static" even though they are referenced
100 * by "extern" statements elsewhere.
102 * OK_DOLLAR Should be set TRUE if $ is a valid alphabetic character
103 * in identifiers (default), or zero if $ is invalid.
104 * Default is TRUE.
106 * OK_CONCAT Should be set TRUE if # may be used to concatenate
107 * tokens in macros (per the Ansi Draft Standard) or
108 * FALSE for old-style # processing (needed if cpp is
109 * to process assembler source code).
111 * OK_DATE Predefines the compilation date if set TRUE.
112 * Not permitted by the Nov. 12, 1984 Draft Standard.
114 * S_CHAR etc. Define the sizeof the basic TARGET machine word types.
115 * By default, sizes are set to the values for the HOST
116 * computer. If this is inappropriate, see the code in
117 * cpp3.c for details on what to change. Also, if you
118 * have a machine where sizeof (signed int) differs from
119 * sizeof (unsigned int), you will have to edit code and
120 * tables in cpp3.c (and extend the -S option definition.)
122 * CPP_LIBRARY May be defined if you have a site-specific include directory
123 * which is to be searched *before* the operating-system
124 * specific directories.
127 #if TARGET == SYS_LATTICE
129 * We assume the operating system is pcdos for the IBM-PC.
130 * We also assume the small model (just like the PDP-11)
132 #define MACHINE "i8086"
133 #define SYSTEM "pcdos"
134 #endif
136 #if TARGET == SYS_ONYX
137 #define MACHINE "z8000"
138 #define SYSTEM "unix"
139 #endif
141 #if TARGET == SYS_VMS
142 #define MACHINE "vax"
143 #define SYSTEM "vms"
144 #define COMPILER "vax11c"
145 #endif
147 #if TARGET == SYS_RSX
148 #define MACHINE "pdp11"
149 #define SYSTEM "rsx"
150 #define COMPILER "decus"
151 #endif
153 #if TARGET == SYS_RT11
154 #define MACHINE "pdp11"
155 #define SYSTEM "rt11"
156 #define COMPILER "decus"
157 #endif
159 #if TARGET == SYS_68000 || defined(M68000) || defined(m68000) || defined(m68k)
161 * All three machine designators have been seen in various systems.
162 * Warning -- compilers differ as to sizeof (int). cpp3 assumes that
163 * sizeof (int) == 2
165 #define MACHINE "M68000", "m68000", "m68k"
166 #define SYSTEM "unix"
167 #endif
169 #if TARGET == SYS_UNIX
170 #define SYSTEM "unix"
171 #ifdef pdp11
172 #define MACHINE "pdp11"
173 #endif
174 #ifdef vax
175 #define MACHINE "vax"
176 #endif
177 #endif
180 * defaults
183 #ifndef MSG_PREFIX
184 #define MSG_PREFIX "cpp: "
185 #endif
187 #ifndef LINE_PREFIX
188 #define LINE_PREFIX ""
189 #endif
192 * OLD_PREPROCESSOR forces the definition of OK_DOLLAR, OK_CONCAT,
193 * COMMENT_INVISIBLE, and STRING_FORMAL to values appropriate for
194 * an old-style preprocessor.
197 #ifndef OLD_PREPROCESSOR
198 #define OLD_PREPROCESSOR FALSE
199 #endif
201 #if OLD_PREPROCESSOR
202 #define OK_DOLLAR FALSE
203 #define OK_CONCAT TRUE
204 #define COMMENT_INVISIBLE TRUE
205 #define STRING_FORMAL TRUE
206 #define IDMAX 63 /* actually, seems to be unlimited */
207 #endif
210 * RECURSION_LIMIT may be set to -1 to disable the macro recursion test.
212 #ifndef RECURSION_LIMIT
213 #define RECURSION_LIMIT 1000
214 #endif
217 * BITS_CHAR may be defined to set the number of bits per character.
218 * it is needed only for multi-byte character constants.
220 #ifndef BITS_CHAR
221 #define BITS_CHAR 8
222 #endif
225 * BIG_ENDIAN is set TRUE on machines (such as the IBM 360 series)
226 * where 'ab' stores 'a' in the high-bits and 'b' in the low-bits.
227 * It is set FALSE on machines (such as the PDP-11 and Vax-11)
228 * where 'ab' stores 'a' in the low-bits and 'b' in the high-bits.
229 * (Or is it the other way around?) -- Warning: BIG_ENDIAN code is untested.
231 #ifndef BIG_ENDIAN
232 #define BIG_ENDIAN FALSE
233 #endif
236 * COMMENT_INVISIBLE may be defined to allow "old-style" comment
237 * processing, whereby the comment becomes a zero-length token
238 * delimiter. This permitted tokens to be concatenated in macro
239 * expansions. This was removed from the Draft Ansi Standard.
241 #ifndef COMMENT_INVISIBLE
242 #define COMMENT_INVISIBLE FALSE
243 #endif
246 * STRING_FORMAL may be defined to allow recognition of macro parameters
247 * anywhere in replacement strings. This was removed from the Draft Ansi
248 * Standard and a limited recognition capability added.
250 #ifndef STRING_FORMAL
251 #define STRING_FORMAL FALSE
252 #endif
255 * OK_DOLLAR enables use of $ as a valid "letter" in identifiers.
256 * This is a permitted extension to the Ansi Standard and is required
257 * for e.g., VMS, RSX-11M, etc. It should be set FALSE if cpp is
258 * used to preprocess assembler source on Unix systems. OLD_PREPROCESSOR
259 * sets OK_DOLLAR FALSE for that reason.
261 #ifndef OK_DOLLAR
262 #define OK_DOLLAR TRUE
263 #endif
266 * OK_CONCAT enables (one possible implementation of) token concatenation.
267 * If cpp is used to preprocess Unix assembler source, this should be
268 * set FALSE as the concatenation character, #, is used by the assembler.
270 #ifndef OK_CONCAT
271 #define OK_CONCAT TRUE
272 #endif
275 * OK_DATE may be enabled to predefine today's date as a string
276 * at the start of each compilation. This is apparently not permitted
277 * by the Draft Ansi Standard.
279 #ifndef OK_DATE
280 #define OK_DATE TRUE
281 #endif
284 * The following definitions are used to allocate memory for
285 * work buffers. In general, they should not be modified
286 * by implementors.
288 * PAR_MAC The maximum number of #define parameters (31 per Standard)
289 * Note: we need another one for strings.
290 * IDMAX The longest identifier, 31 per Ansi Standard
291 * NBUFF Input buffer size
292 * NWORK Work buffer size -- the longest macro
293 * must fit here after expansion.
294 * NEXP The nesting depth of #if expressions
295 * NINCLUDE The number of directories that may be specified
296 * on a per-system basis, or by the -I option.
297 * BLK_NEST The number of nested #if's permitted.
298 * NFWORK FileNameWorkBuffer (added by erAck, was NWORK)
301 #ifndef IDMAX
302 #define IDMAX 127
303 #endif
304 #ifdef SOLAR
305 #define PAR_MAC (253 + 1)
306 #else
307 #define PAR_MAC (31 + 1)
308 #endif
309 /* ER 13.06.95 19:33
310 da Makros im file->buffer expandiert werden, muss NBUFF mindestens NWORK sein
311 #define NWORK 4096
312 #define NBUFF 4096
314 /* ER 13.06.95 20:05 NWORK wg. grooossen Makros in *.src erhoeht,
315 da wir bald 10 Sprachen haben werden gleich ordentlich reingehauen.. */
316 #define NWORK 128000
317 #define NBUFF NWORK
318 #define NFWORK 1024
319 #define NEXP 128
320 #define NINCLUDE 100
321 #define NPARMWORK (NWORK * 2)
322 #define BLK_NEST 32
325 #ifndef ALERT
326 #ifdef EBCDIC
327 #define ALERT '\057'
328 #else
329 #define ALERT '\007' /* '\a' is "Bell" */
330 #endif
331 #endif
333 #ifndef VT
334 #define VT '\013' /* Vertical Tab CTRL/K */
335 #endif
338 #ifndef FILE_LOCAL
339 #ifdef decus
340 #define FILE_LOCAL static
341 #else
342 #ifdef vax11c
343 #define FILE_LOCAL static
344 #else
345 #define FILE_LOCAL /* Others are global */
346 #endif
347 #endif
348 #endif