Subversion Repositories tendra.SVN

Rev

Rev 7 | Details | Compare with Previous | 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 TenDRA keywords */
124
 
125
#if FS_TENDRA
126
#pragma TenDRA keyword SET for set
127
#pragma TenDRA keyword UNUSED for discard variable
128
#pragma TenDRA keyword IGNORE for discard value
129
#pragma TenDRA keyword EXHAUSTIVE for exhaustive
130
#pragma TenDRA keyword REACHED for set reachable
131
#pragma TenDRA keyword UNREACHED for set unreachable
132
#define FALL_THROUGH
133
#endif
134
 
135
 
136
/* Definitions of TenDRA keywords for lint */
137
 
138
#if FS_LINT
139
#define SET( name )
140
#define UNUSED( name )		( name ) = ( name )
141
#define IGNORE			( void )
142
#define EXHAUSTIVE
143
#define REACHED
144
#define UNREACHED
145
#define FALL_THROUGH
146
#endif
147
 
148
 
149
/* Dummy definitions for TenDRA keywords */
150
 
151
#if !FS_TENDRA && !FS_LINT
152
#define SET( name )
153
#define UNUSED( name )
154
#define IGNORE			( void )
155
#define EXHAUSTIVE
156
#define REACHED
157
#define UNREACHED
158
#define FALL_THROUGH
159
#endif
160
 
161
 
162
/* FS_CONST indicates whether const is supported */
163
 
164
#ifndef FS_CONST
165
#define FS_CONST		FS_STDC
166
#endif
167
 
168
 
169
/* FS_VOLATILE indicates whether volatile is supported */
170
 
171
#ifndef FS_VOLATILE
172
#define FS_VOLATILE		FS_STDC
173
#endif
174
 
175
 
176
/* CONST is used in place of const */
177
 
178
#if FS_CONST
179
#define CONST			const
180
#else
181
#define CONST
182
#endif
183
 
184
 
185
/* VOLATILE is used in place of volatile */
186
 
187
#if FS_VOLATILE
188
#define VOLATILE		volatile
189
#else
190
#define VOLATILE
191
#endif
192
 
193
 
194
/* FS_STDC_HASH indicates whether # and ## are supported */
195
 
196
#ifndef FS_STDC_HASH
197
#define FS_STDC_HASH		FS_STDC
198
#endif
199
 
200
 
201
/* FS_STDC_IDENTIFIERS indicates __FILE__ etc. are defined */
202
 
203
#ifndef FS_STDC_IDENTIFIERS
204
#define FS_STDC_IDENTIFIERS	FS_STDC
205
#endif
206
 
207
 
208
/* FS_TRIGRAPH indicates whether trigraphs are supported */
209
 
210
#ifndef FS_TRIGRAPH
211
#define FS_TRIGRAPH		FS_STDC
212
#endif
213
 
214
 
215
/* FS_WIDE_STRING indicates whether wide strings are supported */
216
 
217
#ifndef FS_WIDE_STRING
218
#define FS_WIDE_STRING		FS_STDC
219
#endif
220
 
221
 
222
/* FS_NUMBER_SUFFIX indicates whether the L, U, F suffixes are supported */
223
 
224
#ifndef FS_NUMBER_SUFFIX
225
#define FS_NUMBER_SUFFIX	FS_STDC
226
#endif
227
 
228
 
229
/* FS_CONCAT_STRING indicates whether string concatenation is supported */
230
 
231
#ifndef FS_CONCAT_STRING
232
#define FS_CONCAT_STRING	FS_STDC
233
#endif
234
 
235
 
236
/* FS_SIGNED indicates whether signed is supported */
237
 
238
#ifndef FS_SIGNED
239
#define FS_SIGNED		FS_STDC
240
#endif
241
 
242
 
243
/* FS_LONG_DOUBLE indicates whether long double is supported */
244
 
245
#ifndef FS_LONG_DOUBLE
246
#define FS_LONG_DOUBLE		FS_STDC
247
#endif
248
 
249
 
250
/* FS_ENUMERATION indicates whether enumeration types are supported */
251
 
252
#ifndef FS_ENUMERATION
253
#define FS_ENUMERATION		FS_STDC
254
#endif
255
 
256
 
257
/* FS_TYPEDEF_VOID indicates whether typedef void is supported */
258
 
259
#ifndef FS_TYPEDEF_VOID
260
#define FS_TYPEDEF_VOID		FS_STDC
261
#endif
262
 
263
 
264
/* FS_UNION_INIT indicates whether initialisation of unions is supported */
265
 
266
#ifndef FS_UNION_INIT
267
#define FS_UNION_INIT		FS_STDC
268
#endif
269
 
270
 
271
/* FS_AUTO_STRUCT_INIT indicates whether initialisation of automatic
272
   compound variables is allowed */
273
 
274
#ifndef FS_AUTO_STRUCT_INIT
275
#define FS_AUTO_STRUCT_INIT	FS_STDC
276
#endif
277
 
278
 
279
#endif