Subversion Repositories tendra.SVN

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6 7u83 1
/*
2
 * Copyright (c) 2002-2006 The TenDRA Project <http://www.tendra.org/>.
3
 * All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions are met:
7
 *
8
 * 1. Redistributions of source code must retain the above copyright notice,
9
 *    this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright notice,
11
 *    this list of conditions and the following disclaimer in the documentation
12
 *    and/or other materials provided with the distribution.
13
 * 3. Neither the name of The TenDRA Project nor the names of its contributors
14
 *    may be used to endorse or promote products derived from this software
15
 *    without specific, prior written permission.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
18
 * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
19
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
21
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22
 * EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
 *
29
 * $Id$
30
 */
31
/*
32
    		 Crown Copyright (c) 1997, 1998
33
 
34
    This TenDRA(r) Computer Program is subject to Copyright
35
    owned by the United Kingdom Secretary of State for Defence
36
    acting through the Defence Evaluation and Research Agency
37
    (DERA).  It is made available to Recipients with a
38
    royalty-free licence for its use, reproduction, transfer
39
    to other parties and amendment for any purpose not excluding
40
    product development provided that any such use et cetera
41
    shall be deemed to be acceptance of the following conditions:-
42
 
43
        (1) Its Recipients shall ensure that this Notice is
44
        reproduced upon any copies or amended versions of it;
45
 
46
        (2) Any amended version of it shall be clearly marked to
47
        show both the nature of and the organisation responsible
48
        for the relevant amendment or amendments;
49
 
50
        (3) Its onward transfer from a recipient to another
51
        party shall be deemed to be that party's acceptance of
52
        these conditions;
53
 
54
        (4) DERA gives no warranty or assurance as to its
55
        quality or suitability for any purpose and DERA accepts
56
        no liability whatsoever in relation to any use to which
57
        it may be put.
58
*/
59
 
60
 
61
#ifndef TENDRA_INCLUDED
62
#define TENDRA_INCLUDED
63
 
64
 
65
/*
66
    TENDRA STANDARD COMPILER HEADER
67
 
68
    This headers defines feature switch macros for various compiler
69
    features.  These can be 1, if the feature is allowed, or 0, otherwise.
70
    Standard versions of the TenDRA keywords are also provided.
71
*/
72
 
73
 
74
/* FS_CPLUSPLUS indicates a C++ compiler */
75
 
76
#ifndef FS_CPLUSPLUS
77
#ifdef __cplusplus
78
#define FS_CPLUSPLUS		1
79
#define FS_STDC			1
80
#else
81
#define FS_CPLUSPLUS		0
82
#endif
83
#endif
84
 
85
 
86
/* FS_STDC indicates an ISO C compliant compiler */
87
 
88
#ifndef FS_STDC
89
#ifdef __STDC__
90
#define FS_STDC			1
91
#else
92
#define FS_STDC			0
93
#endif
94
#endif
95
 
96
 
97
/* FS_TENDRA indicates the TenDRA C compiler */
98
 
99
#ifndef FS_TENDRA
100
#ifdef __TenDRA__
101
#define FS_TENDRA		1
102
#else
103
#define FS_TENDRA		0
104
#endif
105
#endif
106
 
107
 
108
/* FS_GNUC indicates the GNU C compiler */
109
 
110
#ifndef FS_GNUC
111
#ifdef __GNUC__
112
#define FS_GNUC			1
113
#else
114
#define FS_GNUC			0
115
#endif
116
#endif
117
 
118
 
119
/* FS_LINT indicates lint */
120
 
121
#ifndef FS_LINT
122
#if defined(lint) || defined(__lint)
123
#define FS_LINT			1
124
#else
125
#define FS_LINT			0
126
#endif
127
#endif
128
 
129
 
130
/* FS_PROTOTYPES indicates whether the compiler has prototypes */
131
 
132
#ifndef FS_PROTOTYPES
133
#define FS_PROTOTYPES		FS_STDC
134
#endif
135
 
136
 
137
/* FS_WEAK_PROTOTYPES indicates whether the compiler has weak prototypes */
138
 
139
#ifndef FS_WEAK_PROTOTYPES
140
#define FS_WEAK_PROTOTYPES	(FS_TENDRA && !FS_CPLUSPLUS)
141
#endif
142
 
143
 
144
/* FS_STDARG indicates whether the compiler has <stdarg.h> */
145
 
146
#ifndef FS_STDARG
147
#define FS_STDARG		FS_STDC
148
#endif
149
 
150
 
151
/* Definitions of TenDRA keywords */
152
 
153
#if FS_TENDRA
154
#pragma TenDRA keyword SET for set
155
#pragma TenDRA keyword UNUSED for discard variable
156
#pragma TenDRA keyword IGNORE for discard value
157
#pragma TenDRA keyword EXHAUSTIVE for exhaustive
158
#pragma TenDRA keyword REACHED for set reachable
159
#pragma TenDRA keyword UNREACHED for set unreachable
160
#define FALL_THROUGH
161
#endif
162
 
163
 
164
/* Definitions of TenDRA keywords for lint */
165
 
166
#if FS_LINT
167
#define SET(name)
168
#define UNUSED(name)		(name) = (name)
169
#define IGNORE			(void)
170
#define EXHAUSTIVE
171
#define REACHED
172
#define UNREACHED
173
#define FALL_THROUGH
174
#endif
175
 
176
 
177
/* Dummy definitions for TenDRA keywords */
178
 
179
#if !FS_TENDRA && !FS_LINT
180
#define SET(name)
181
#define UNUSED(name)
182
#define IGNORE			(void)
183
#define EXHAUSTIVE
184
#define REACHED
185
#define UNREACHED
186
#define FALL_THROUGH
187
#endif
188
 
189
 
190
/* FS_CONST indicates whether const is supported */
191
 
192
#ifndef FS_CONST
193
#define FS_CONST		FS_STDC
194
#endif
195
 
196
 
197
/* FS_VOLATILE indicates whether volatile is supported */
198
 
199
#ifndef FS_VOLATILE
200
#define FS_VOLATILE		FS_STDC
201
#endif
202
 
203
 
204
/* CONST is used in place of const */
205
 
206
#if FS_CONST
207
#define CONST			const
208
#else
209
#define CONST
210
#endif
211
 
212
 
213
/* VOLATILE is used in place of volatile */
214
 
215
#if FS_VOLATILE
216
#define VOLATILE		volatile
217
#else
218
#define VOLATILE
219
#endif
220
 
221
 
222
/* FS_STDC_HASH indicates whether # and ## are supported */
223
 
224
#ifndef FS_STDC_HASH
225
#define FS_STDC_HASH		FS_STDC
226
#endif
227
 
228
 
229
/* FS_STDC_IDENTIFIERS indicates __FILE__ etc. are defined */
230
 
231
#ifndef FS_STDC_IDENTIFIERS
232
#define FS_STDC_IDENTIFIERS	FS_STDC
233
#endif
234
 
235
 
236
/* FS_TRIGRAPH indicates whether trigraphs are supported */
237
 
238
#ifndef FS_TRIGRAPH
239
#define FS_TRIGRAPH		FS_STDC
240
#endif
241
 
242
 
243
/* FS_WIDE_STRING indicates whether wide strings are supported */
244
 
245
#ifndef FS_WIDE_STRING
246
#define FS_WIDE_STRING		FS_STDC
247
#endif
248
 
249
 
250
/* FS_NUMBER_SUFFIX indicates whether the L, U, F suffixes are supported */
251
 
252
#ifndef FS_NUMBER_SUFFIX
253
#define FS_NUMBER_SUFFIX	FS_STDC
254
#endif
255
 
256
 
257
/* FS_CONCAT_STRING indicates whether string concatenation is supported */
258
 
259
#ifndef FS_CONCAT_STRING
260
#define FS_CONCAT_STRING	FS_STDC
261
#endif
262
 
263
 
264
/* FS_SIGNED indicates whether signed is supported */
265
 
266
#ifndef FS_SIGNED
267
#define FS_SIGNED		FS_STDC
268
#endif
269
 
270
 
271
/* FS_LONG_DOUBLE indicates whether long double is supported */
272
 
273
#ifndef FS_LONG_DOUBLE
274
#define FS_LONG_DOUBLE		FS_STDC
275
#endif
276
 
277
 
278
/* FS_ENUMERATION indicates whether enumeration types are supported */
279
 
280
#ifndef FS_ENUMERATION
281
#define FS_ENUMERATION		FS_STDC
282
#endif
283
 
284
 
285
/* FS_TYPEDEF_VOID indicates whether typedef void is supported */
286
 
287
#ifndef FS_TYPEDEF_VOID
288
#define FS_TYPEDEF_VOID		FS_STDC
289
#endif
290
 
291
 
292
/* FS_UNION_INIT indicates whether initialisation of unions is supported */
293
 
294
#ifndef FS_UNION_INIT
295
#define FS_UNION_INIT		FS_STDC
296
#endif
297
 
298
 
299
/* FS_AUTO_STRUCT_INIT indicates whether initialisation of automatic
300
   compound variables is allowed */
301
 
302
#ifndef FS_AUTO_STRUCT_INIT
303
#define FS_AUTO_STRUCT_INIT	FS_STDC
304
#endif
305
 
306
 
307
#endif /* !TENDRA_INCLUDED */