Subversion Repositories tendra.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
2
    		 Crown Copyright (c) 1997, 1998
3
 
4
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
12
 
13
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
15
 
16
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
19
 
20
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
22
        these conditions;
23
 
24
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
27
        it may be put.
28
*/
29
 
30
 
31
#ifndef OSSG_INCLUDED
32
#define OSSG_INCLUDED
33
 
34
 
35
/*
36
    OSSG STANDARD COMPILER HEADER, VERSION 1.1
37
 
38
    This headers defines feature switch macros for various compiler
39
    features.  These can be 1, if the feature is allowed, or 0, otherwise.
40
    These switches are used to define the PROTO macros described in the
41
    OSSG C coding standard.  Standard versions of the TenDRA keywords
42
    are also provided.
43
*/
44
 
45
 
46
/* FS_CPLUSPLUS indicates a C++ compiler */
47
 
48
#ifndef FS_CPLUSPLUS
49
#ifdef __cplusplus
50
#define FS_CPLUSPLUS		1
51
#define FS_STDC			1
52
#else
53
#define FS_CPLUSPLUS		0
54
#endif
55
#endif
56
 
57
 
58
/* FS_STDC indicates an ISO C compliant compiler */
59
 
60
#ifndef FS_STDC
61
#ifdef __STDC__
62
#define FS_STDC			1
63
#else
64
#define FS_STDC			0
65
#endif
66
#endif
67
 
68
 
69
/* FS_TENDRA indicates the TenDRA C compiler */
70
 
71
#ifndef FS_TENDRA
72
#ifdef __TenDRA__
73
#define FS_TENDRA		1
74
#else
75
#define FS_TENDRA		0
76
#endif
77
#endif
78
 
79
 
80
/* FS_GNUC indicates the GNU C compiler */
81
 
82
#ifndef FS_GNUC
83
#ifdef __GNUC__
84
#define FS_GNUC			1
85
#else
86
#define FS_GNUC			0
87
#endif
88
#endif
89
 
90
 
91
/* FS_LINT indicates lint */
92
 
93
#ifndef FS_LINT
94
#if defined ( lint ) || defined ( __lint )
95
#define FS_LINT			1
96
#else
97
#define FS_LINT			0
98
#endif
99
#endif
100
 
101
 
102
/* FS_PROTOTYPES indicates whether the compiler has prototypes */
103
 
104
#ifndef FS_PROTOTYPES
105
#define FS_PROTOTYPES		FS_STDC
106
#endif
107
 
108
 
109
/* FS_WEAK_PROTOTYPES indicates whether the compiler has weak prototypes */
110
 
111
#ifndef FS_WEAK_PROTOTYPES
112
#define FS_WEAK_PROTOTYPES	( FS_TENDRA && !FS_CPLUSPLUS )
113
#endif
114
 
115
 
116
/* FS_STDARG indicates whether the compiler has <stdarg.h> */
117
 
118
#ifndef FS_STDARG
119
#define FS_STDARG		FS_STDC
120
#endif
121
 
122
 
123
/* Definitions of PROTO macros for weak prototypes */
124
 
125
#if FS_WEAK_PROTOTYPES
126
#ifndef PROTO_S
127
#pragma TenDRA keyword KW_WEAK_PROTOTYPE for weak
128
#define PROTO_S( types )	KW_WEAK_PROTOTYPE types
129
#define PROTO_N( names )	names
130
#define PROTO_T( params )	params ;
131
#define PROTO_Z()		()
132
#define PROTO_X			;
133
#endif
134
#endif
135
 
136
 
137
/* Definitions of PROTO macros for prototypes */
138
 
139
#if FS_PROTOTYPES
140
#ifndef PROTO_S
141
#define PROTO_S( types )	types
142
#define PROTO_N( names )
143
#define PROTO_T( params )	( params )
144
#define PROTO_Z()		( void )
145
#define PROTO_X			,
146
#endif
147
#endif
148
 
149
 
150
/* Definitions of PROTO macros for non-prototypes */
151
 
152
#ifndef PROTO_S
153
#define PROTO_S( types )	()
154
#define PROTO_N( names )	names
155
#define PROTO_T( params )	params ;
156
#define PROTO_Z()		()
157
#define PROTO_X			;
158
#endif
159
 
160
 
161
/* Definitions of PROTO_V macros */
162
 
163
#if FS_STDARG
164
#define PROTO_V( params )	params
165
#define PROTO_W( types )	types
166
#else
167
#define PROTO_V( parms )	( va_alist ) va_dcl
168
#define PROTO_W( types )	()
169
#endif
170
 
171
 
172
/* Definition of prototype separator macro */
173
 
174
#ifdef X
175
#undef X
176
#endif
177
#define X			PROTO_X
178
 
179
 
180
/* Definitions of TenDRA keywords */
181
 
182
#if FS_TENDRA
183
#pragma TenDRA keyword SET for set
184
#pragma TenDRA keyword UNUSED for discard variable
185
#pragma TenDRA keyword IGNORE for discard value
186
#pragma TenDRA keyword EXHAUSTIVE for exhaustive
187
#pragma TenDRA keyword REACHED for set reachable
188
#pragma TenDRA keyword UNREACHED for set unreachable
189
#define FALL_THROUGH
190
#endif
191
 
192
 
193
/* Definitions of TenDRA keywords for lint */
194
 
195
#if FS_LINT
196
#define SET( name )
197
#define UNUSED( name )		( name ) = ( name )
198
#define IGNORE			( void )
199
#define EXHAUSTIVE
200
#define REACHED
201
#define UNREACHED
202
#define FALL_THROUGH
203
#endif
204
 
205
 
206
/* Dummy definitions for TenDRA keywords */
207
 
208
#if !FS_TENDRA && !FS_LINT
209
#define SET( name )
210
#define UNUSED( name )
211
#define IGNORE			( void )
212
#define EXHAUSTIVE
213
#define REACHED
214
#define UNREACHED
215
#define FALL_THROUGH
216
#endif
217
 
218
 
219
/* FS_CONST indicates whether const is supported */
220
 
221
#ifndef FS_CONST
222
#define FS_CONST		FS_STDC
223
#endif
224
 
225
 
226
/* FS_VOLATILE indicates whether volatile is supported */
227
 
228
#ifndef FS_VOLATILE
229
#define FS_VOLATILE		FS_STDC
230
#endif
231
 
232
 
233
/* CONST is used in place of const */
234
 
235
#if FS_CONST
236
#define CONST			const
237
#else
238
#define CONST
239
#endif
240
 
241
 
242
/* VOLATILE is used in place of volatile */
243
 
244
#if FS_VOLATILE
245
#define VOLATILE		volatile
246
#else
247
#define VOLATILE
248
#endif
249
 
250
 
251
/* FS_STDC_HASH indicates whether # and ## are supported */
252
 
253
#ifndef FS_STDC_HASH
254
#define FS_STDC_HASH		FS_STDC
255
#endif
256
 
257
 
258
/* FS_STDC_IDENTIFIERS indicates __FILE__ etc. are defined */
259
 
260
#ifndef FS_STDC_IDENTIFIERS
261
#define FS_STDC_IDENTIFIERS	FS_STDC
262
#endif
263
 
264
 
265
/* FS_TRIGRAPH indicates whether trigraphs are supported */
266
 
267
#ifndef FS_TRIGRAPH
268
#define FS_TRIGRAPH		FS_STDC
269
#endif
270
 
271
 
272
/* FS_WIDE_STRING indicates whether wide strings are supported */
273
 
274
#ifndef FS_WIDE_STRING
275
#define FS_WIDE_STRING		FS_STDC
276
#endif
277
 
278
 
279
/* FS_NUMBER_SUFFIX indicates whether the L, U, F suffixes are supported */
280
 
281
#ifndef FS_NUMBER_SUFFIX
282
#define FS_NUMBER_SUFFIX	FS_STDC
283
#endif
284
 
285
 
286
/* FS_CONCAT_STRING indicates whether string concatenation is supported */
287
 
288
#ifndef FS_CONCAT_STRING
289
#define FS_CONCAT_STRING	FS_STDC
290
#endif
291
 
292
 
293
/* FS_PTR_VOID indicates whether void * is supported */
294
 
295
#ifndef FS_PTR_VOID
296
#define FS_PTR_VOID		FS_STDC
297
#endif
298
 
299
 
300
/* FS_SIGNED indicates whether signed is supported */
301
 
302
#ifndef FS_SIGNED
303
#define FS_SIGNED		FS_STDC
304
#endif
305
 
306
 
307
/* FS_LONG_DOUBLE indicates whether long double is supported */
308
 
309
#ifndef FS_LONG_DOUBLE
310
#define FS_LONG_DOUBLE		FS_STDC
311
#endif
312
 
313
 
314
/* FS_ENUMERATION indicates whether enumeration types are supported */
315
 
316
#ifndef FS_ENUMERATION
317
#define FS_ENUMERATION		FS_STDC
318
#endif
319
 
320
 
321
/* FS_TYPEDEF_VOID indicates whether typedef void is supported */
322
 
323
#ifndef FS_TYPEDEF_VOID
324
#define FS_TYPEDEF_VOID		FS_STDC
325
#endif
326
 
327
 
328
/* FS_UNION_INIT indicates whether initialisation of unions is supported */
329
 
330
#ifndef FS_UNION_INIT
331
#define FS_UNION_INIT		FS_STDC
332
#endif
333
 
334
 
335
/* FS_AUTO_STRUCT_INIT indicates whether initialisation of automatic
336
   compound variables is allowed */
337
 
338
#ifndef FS_AUTO_STRUCT_INIT
339
#define FS_AUTO_STRUCT_INIT	FS_STDC
340
#endif
341
 
342
 
343
#endif