1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: cppdef.h,v $
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.
41 * Define the HOST operating system. This is needed so that
42 * cpp can use appropriate filename conventions.
72 #define HOST SYS_UNKNOWN
76 * We assume that the target is the same as the host system
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.
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"
136 #if TARGET == SYS_ONYX
137 #define MACHINE "z8000"
138 #define SYSTEM "unix"
141 #if TARGET == SYS_VMS
142 #define MACHINE "vax"
144 #define COMPILER "vax11c"
147 #if TARGET == SYS_RSX
148 #define MACHINE "pdp11"
150 #define COMPILER "decus"
153 #if TARGET == SYS_RT11
154 #define MACHINE "pdp11"
155 #define SYSTEM "rt11"
156 #define COMPILER "decus"
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
165 #define MACHINE "M68000", "m68000", "m68k"
166 #define SYSTEM "unix"
169 #if TARGET == SYS_UNIX
170 #define SYSTEM "unix"
172 #define MACHINE "pdp11"
175 #define MACHINE "vax"
184 #define MSG_PREFIX "cpp: "
188 #define LINE_PREFIX ""
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
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 */
210 * RECURSION_LIMIT may be set to -1 to disable the macro recursion test.
212 #ifndef RECURSION_LIMIT
213 #define RECURSION_LIMIT 1000
217 * BITS_CHAR may be defined to set the number of bits per character.
218 * it is needed only for multi-byte character constants.
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.
232 #define BIG_ENDIAN FALSE
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
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
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.
262 #define OK_DOLLAR TRUE
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.
271 #define OK_CONCAT TRUE
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.
284 * The following definitions are used to allocate memory for
285 * work buffers. In general, they should not be modified
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)
305 #define PAR_MAC (253 + 1)
307 #define PAR_MAC (31 + 1)
310 da Makros im file->buffer expandiert werden, muss NBUFF mindestens NWORK sein
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.. */
321 #define NPARMWORK (NWORK * 2)
329 #define ALERT '\007' /* '\a' is "Bell" */
334 #define VT '\013' /* Vertical Tab CTRL/K */
340 #define FILE_LOCAL static
343 #define FILE_LOCAL static
345 #define FILE_LOCAL /* Others are global */