-
Notifications
You must be signed in to change notification settings - Fork 1
/
como.h
482 lines (366 loc) · 14.9 KB
/
como.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
/* /////////////////////////////////////////////////////////////////////////
* File: stlsoft/internal/cccap/como.h
*
* Purpose: Compiler feature discrimination for Comeau C/C++.
*
* Created: 7th February 2003
* Updated: 3rd February 2012
*
* Home: http://stlsoft.org/
*
* Copyright (c) 2003-2012, Matthew Wilson and Synesis Software
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
* any contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* ////////////////////////////////////////////////////////////////////// */
#ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
# error This file must not be included independently of stlsoft/stlsoft.h
#endif /* !STLSOFT_INCL_STLSOFT_H_STLSOFT */
/** \file stlsoft/internal/cccap/como.h
*
* Compiler feature discrimination for Comeau C/C++
* (\ref group__library__internal).
*/
#ifdef STLSOFT_INCL_H_STLSOFT_CCCAP_COMO
# error This file cannot be included more than once in any compilation unit
#endif /* STLSOFT_INCL_H_STLSOFT_CCCAP_COMO */
/* ////////////////////////////////////////////////////////////////////// */
#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
# define STLSOFT_VER_H_STLSOFT_CCCAP_COMO_MAJOR 3
# define STLSOFT_VER_H_STLSOFT_CCCAP_COMO_MINOR 16
# define STLSOFT_VER_H_STLSOFT_CCCAP_COMO_REVISION 2
# define STLSOFT_VER_H_STLSOFT_CCCAP_COMO_EDIT 69
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/* /////////////////////////////////////////////////////////////////////////
* Auto-generation and compatibility
*/
/*
[<[STLSOFT-AUTO:NO-DOCFILELABEL]>]
[<[STLSOFT-AUTO:NO-UNITTEST]>]
*/
/* /////////////////////////////////////////////////////////////////////////
* Back end discrimination
*/
#if defined(__BORLANDC__)
# define STLSOFT_CF_COMO_BACKEND_IS_BORLAND
#elif defined(__DMC__)
# define STLSOFT_CF_COMO_BACKEND_IS_DMC
#elif defined(__GNUC__)
# define STLSOFT_CF_COMO_BACKEND_IS_GCC
#elif defined(__INTEL_COMPILER)
# define STLSOFT_CF_COMO_BACKEND_IS_INTEL
#elif defined(__MWERKS__)
# define STLSOFT_CF_COMO_BACKEND_IS_MWERKS
#elif defined(_MSC_VER)
# define STLSOFT_CF_COMO_BACKEND_IS_MSVC
#else /* ? compiler */
# error Your Comeau back-end is not recognised. Please contact admin hat stlsoft dot org
#endif /* compiler */
/* /////////////////////////////////////////////////////////////////////////
* Compiler features
*/
/* Messaging
*/
/* #define STLSOFT_CF_PRAGMA_MESSAGE_SUPPORT */
/* Support for #pragma once
*/
#define STLSOFT_CF_PRAGMA_ONCE_SUPPORT
/* Support for __FUNCTION__
*/
#define STLSOFT_CF_FUNCTION_SYMBOL_SUPPORT
/* Variadic Macros
*/
#define STLSOFT_CF_SUPPORTS_VARIADIC_MACROS
/* Types:
*/
/* bool */
#ifdef _BOOL
# define STLSOFT_CF_NATIVE_BOOL_SUPPORT
#else
/* Not defined */
#endif /* _BOOL_DEFINED */
/* wchar_t */
#ifdef _WCHAR_T
# define STLSOFT_CF_NATIVE_WCHAR_T_SUPPORT
#else
/* Not defined */
#endif /* _WCHAR_T_DEFINED */
/* ////////////////////////////////////////////////////////////////////// */
/* ////////////////////////////////////////////////////////////////////// */
/* ////////////////////////////////////////////////////////////////////// */
/* ////////////////////////////////////////////////////////////////////// */
/* ////////////////////////////////////////////////////////////////////// */
/* ////////////////////////////////////////////////////////////////////// */
/* ////////////////////////////////////////////////////////////////////// */
/* ////////////////////////////////////////////////////////////////////// */
/* ////////////////////////////////////////////////////////////////////// */
/* ////////////////////////////////////////////////////////////////////// */
/* /////////////////////////////////////////////////////////////////////////
* Integral types
*
* The purpose of this section is to define the following types:
*
* - 8-bit signed and unsigned integers
* - 16-bit signed and unsigned integers
* - 32-bit signed and unsigned integers
* - (optionally) 64-bit signed and unsigned integers
*
* and to define, where appropriate the following symbols (used for
* overloading):
*
* - STLSOFT_CF_CHAR_DISTINCT_INT_TYPE
* - STLSOFT_CF_SHORT_DISTINCT_INT_TYPE
* - STLSOFT_CF_INT_DISTINCT_INT_TYPE
* - STLSOFT_CF_LONG_DISTINCT_INT_TYPE
* - STLSOFT_CF_LONG_LONG_DISTINCT_INT_TYPE
*
* which indicate that a given type is not used in the size-specific types.
*/
#if defined(__LP64__)
# define _STLSOFT_SIZEOF_CHAR (1)
# define _STLSOFT_SIZEOF_SHORT (2)
# define _STLSOFT_SIZEOF_INT (4)
# define _STLSOFT_SIZEOF_LONG (8)
# define _STLSOFT_SIZEOF_LONG_LONG (8)
#elif defined(__linux__) || \
defined(__APPLE__)
# define _STLSOFT_SIZEOF_CHAR (1)
# define _STLSOFT_SIZEOF_SHORT (2)
# define _STLSOFT_SIZEOF_INT (4)
# define _STLSOFT_SIZEOF_LONG (4)
# define _STLSOFT_SIZEOF_LONG_LONG (8)
#elif defined(_WIN64) || \
defined(_WIN32)
# define _STLSOFT_SIZEOF_CHAR (1)
# define _STLSOFT_SIZEOF_SHORT (2)
# define _STLSOFT_SIZEOF_INT (4)
# define _STLSOFT_SIZEOF_LONG (4)
# define _STLSOFT_SIZEOF_LONG_LONG (8)
#else /* ? data model */
# error Use of Comeau has not been verified on any operation system other than Win32. Please contact Synesis Software
#endif /* data model */
/* 8-bit integer */
#define STLSOFT_CF_8BIT_INT_SUPPORT
#define STLSOFT_SI08_T_BASE_TYPE signed char
#define STLSOFT_UI08_T_BASE_TYPE unsigned char
/* 16-bit integer */
#define STLSOFT_CF_16BIT_INT_SUPPORT
#define STLSOFT_SI16_T_BASE_TYPE signed short
#define STLSOFT_UI16_T_BASE_TYPE unsigned short
/* 32-bit integer */
#define STLSOFT_CF_32BIT_INT_SUPPORT
#define STLSOFT_SI32_T_BASE_TYPE signed int
#define STLSOFT_UI32_T_BASE_TYPE unsigned int
#define STLSOFT_CF_LONG_DISTINCT_INT_TYPE
/* 64-bit integer */
#define STLSOFT_CF_64BIT_INT_SUPPORT
#define STLSOFT_CF_64BIT_INT_IS_long_long
#define STLSOFT_SI64_T_BASE_TYPE signed long long
#define STLSOFT_UI64_T_BASE_TYPE unsigned long long
/* Member constants */
#define STLSOFT_CF_MEMBER_CONSTANT_SUPPORT
/* Static assertions */
#define STLSOFT_CF_STATIC_ASSERT_SUPPORT
/* RTTI support */
#ifdef __cplusplus
# define STLSOFT_CF_RTTI_SUPPORT
#endif /* __cplusplus */
/* Exception support */
#ifdef __cplusplus
# define STLSOFT_CF_EXCEPTION_SUPPORT
#endif /* __cplusplus */
/* */
#define STLSOFT_CF_FUNCTION_SIGNATURE_FULL_ARG_QUALIFICATION_REQUIRED
/* Namespace support */
/* #define _STLSOFT_NO_NAMESPACES */
#ifdef __cplusplus
# define STLSOFT_CF_NAMESPACE_SUPPORT
#endif /* __cplusplus */
#define STLSOFT_CF_ANONYMOUS_UNION_SUPPORT
#if __COMO__ >= 4303
# define STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID
#endif /* __COMO__ >= 4303 */
/* Template support */
#define STLSOFT_CF_TEMPLATE_SUPPORT
/* #define STLSOFT_CF_TEMPLATE_TYPE_REQUIRED_IN_ARGS */
#define STLSOFT_CF_EXCEPTION_SIGNATURE_SUPPORT
#define STLSOFT_CF_EXCEPTION_SPEC_EXPENSIVE
#define STLSOFT_CF_THROW_BAD_ALLOC
#define STLSOFT_CF_TEMPLATE_CLASS_DEFAULT_FUNDAMENTAL_ARGUMENT_SUPPORT
#define STLSOFT_CF_TEMPLATE_CLASS_DEFAULT_CLASS_ARGUMENT_SUPPORT
#define STLSOFT_CF_MEM_FUNC_AS_TEMPLATE_PARAM_SUPPORT
#define STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT
#define STLSOFT_CF_MEMBER_TEMPLATE_OVERLOAD_DISCRIMINATED
#define STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT
#define STLSOFT_CF_MEMBER_TEMPLATE_CTOR_OVERLOAD_DISCRIMINATED
#define STLSOFT_CF_MEMBER_TEMPLATE_RANGE_METHOD_SUPPORT
#define STLSOFT_CF_MEMBER_TEMPLATE_CLASS_SUPPORT
#define STLSOFT_CF_TEMPLATE_SPECIALISATION_SYNTAX
#define STLSOFT_CF_TEMPLATE_PARTIAL_SPECIALISATION_SUPPORT
#define STLSOFT_CF_TEMPLATE_OUTOFCLASSFN_QUALIFIED_TYPE_SUPPORT
#define STLSOFT_CF_std_NAMESPACE
#define STLSOFT_CF_std_char_traits_AVAILABLE
#define STLSOFT_CF_PARENT_TYPES_CAN_BE_USED_IN_NON_TEMPLATE
#define STLSOFT_CF_PARENT_TYPES_CAN_BE_USED_IN_TEMPLATE
#define STLSOFT_CF_EXPLICIT_KEYWORD_SUPPORT
#define STLSOFT_CF_MUTABLE_KEYWORD_SUPPORT
#define STLSOFT_CF_TYPENAME_PARAM_KEYWORD_SUPPORT
#define STLSOFT_CF_TYPENAME_TYPE_KEYWORD_SUPPORT
#define STLSOFT_CF_TYPENAME_TYPE_DEF_KEYWORD_SUPPORT
/* #define STLSOFT_CF_TYPENAME_TYPE_MIL_KEYWORD_SUPPORT */
#define STLSOFT_CF_TYPENAME_TYPE_RET_KEYWORD_SUPPORT
#define STLSOFT_CF_TEMPLATE_QUALIFIER_KEYWORD_SUPPORT
/* #define STLSOFT_CF_MOVE_CONSTRUCTOR_SUPPORT */
#define STLSOFT_CF_ADL_LOOKUP_SUPPORT
#define STLSOFT_CF_TEMPLATE_TEMPLATE_SUPPORT
#define STLSOFT_CF_STATIC_ARRAY_SIZE_DETERMINATION_SUPPORT
#define STLSOFT_CF_VENEER_SUPPORT
#define STLSOFT_CF_ALLOCATOR_BASE_EXPENSIVE
/* #define STLSOFT_CF_COMPILER_WARNS_NO_PUBLIC_DTOR */
/* Shims are supported */
/* #define STLSOFT_CF_TEMPLATE_SHIMS_NOT_SUPPORTED */
#define STLSOFT_CF_NEGATIVE_MODULUS_POSITIVE_GIVES_NEGATIVE_RESULT
#define STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT
#define STLSOFT_CF_OPERATOR_NOT_VIA_OPERATOR_POINTER_TO_MEMBER_SUPPORT
/* /////////////////////////////////////////////////////////////////////////
* Quality assurance features
*/
#if defined(_STLSOFT_CUSTOM_ASSERT)
/* You have defined the preprocessor symbol _STLSOFT_CUSTOM_ASSERT,
* which stipulates that you will be providing your own assert. This
* requires that you have defined _STLSOFT_CUSTOM_ASSERT() as a macro
* taking 1 parameter (the condition to assert).
*
* Suppose you have a function DisplayAssert_(), which has the
* following signature:
*
* void DisplayAssert_(char const* file, int line, char const* expression);
*
* Presumably you would also have your own assert macro, say MY_ASSERT(),
* defined as:
*
* #define MY_ASSERT(_x) ((void)((!(_x)) ? ((void)(DisplayAssert_(__FILE__, __LINE__, #_x))) : ((void)0)))
*
* so you would simply need to define _STLSOFT_CUSTOM_ASSERT() in terms of
* MY_ASSERT(), as in:
*
* #define _STLSOFT_CUSTOM_ASSERT(_x) MY_ASSERT(_x)
*
* where
*/
# define __STLSOFT_CF_ASSERT_SUPPORT
# define STLSOFT_CF_ASSERT_SUPPORT
# define STLSOFT_ASSERT(_x) _STLSOFT_CUSTOM_ASSERT(_x)
# if defined(_STLSOFT_CUSTOM_ASSERT_INCLUDE)
# define __STLSOFT_CF_ASSERT_INCLUDE_NAME _STLSOFT_CUSTOM_ASSERT_INCLUDE
# else
# error You must define _STLSOFT_CUSTOM_ASSERT_INCLUDE along with _STLSOFT_CUSTOM_ASSERT()
# endif /* !_STLSOFT_CUSTOM_ASSERT_INCLUDE */
#else /* ? _STLSOFT_CUSTOM_ASSERT */
# if defined(STLSOFT_CF_COMO_BACKEND_IS_BORLAND)
# define __STLSOFT_CF_ASSERT_INCLUDE_NAME <assert.h>
# define STLSOFT_ASSERT(_x) assert(_x)
# else /* compiler */
# define __STLSOFT_CF_ASSERT_SUPPORT
# define STLSOFT_CF_ASSERT_SUPPORT
# define __STLSOFT_CF_USE_cassert
# endif /* compiler */
#endif /* _STLSOFT_CUSTOM_ASSERT */
/* /////////////////////////////////////////////////////////////////////////
* Calling convention
*/
#define STLSOFT_CF_CDECL_SUPPORTED
#if defined(__STDC__)
/* Neither fastcall nor stdcall are supported in strict mode. */
#else /* ? std C */
# if defined(STLSOFT_CF_COMO_BACKEND_IS_BORLAND)
# define STLSOFT_CF_THISCALL_SUPPORTED
# define STLSOFT_CF_FASTCALL_SUPPORTED
# define STLSOFT_CF_STDCALL_SUPPORTED
# define STLSOFT_CDECL __cdecl
# define STLSOFT_FASTCALL __msfastcall
# define STLSOFT_STDCALL __stdcall
# elif defined(STLSOFT_CF_COMO_BACKEND_IS_DMC)
# define STLSOFT_CF_THISCALL_SUPPORTED
# define STLSOFT_CF_STDCALL_SUPPORTED
# define STLSOFT_CDECL __cdecl
# define STLSOFT_STDCALL __stdcall
# elif defined(STLSOFT_CF_COMO_BACKEND_IS_GCC)
# if defined(WIN32) || \
defined(WIN64)
# define STLSOFT_CF_THISCALL_SUPPORTED
# define STLSOFT_CF_FASTCALL_SUPPORTED
# define STLSOFT_CF_STDCALL_SUPPORTED
# define STLSOFT_CDECL __cdecl
# define STLSOFT_FASTCALL __fastcall
# define STLSOFT_STDCALL __stdcall
# endif /* Windows */
# elif defined(STLSOFT_CF_COMO_BACKEND_IS_INTEL)
# if defined(WIN32) || \
defined(WIN64)
# define STLSOFT_CF_THISCALL_SUPPORTED
# define STLSOFT_CF_FASTCALL_SUPPORTED
# define STLSOFT_CF_STDCALL_SUPPORTED
# define STLSOFT_CDECL __cdecl
# define STLSOFT_FASTCALL __fastcall
# define STLSOFT_STDCALL __stdcall
# endif /* Windows */
# elif defined(STLSOFT_CF_COMO_BACKEND_IS_MWERKS)
# if defined(WIN32) || \
defined(WIN64)
# define STLSOFT_CF_THISCALL_SUPPORTED
# define STLSOFT_CF_FASTCALL_SUPPORTED
# define STLSOFT_CF_STDCALL_SUPPORTED
# define STLSOFT_CDECL __cdecl
# define STLSOFT_FASTCALL __fastcall
# define STLSOFT_STDCALL __stdcall
# endif /* Windows */
# elif defined(STLSOFT_CF_COMO_BACKEND_IS_MSVC)
# define STLSOFT_CF_THISCALL_SUPPORTED
# define STLSOFT_CF_FASTCALL_SUPPORTED
# define STLSOFT_CF_STDCALL_SUPPORTED
# define STLSOFT_CDECL __cdecl
# define STLSOFT_FASTCALL __fastcall
# define STLSOFT_STDCALL __stdcall
# else
# error Unrecognised compiler
# endif /* ? compiler */
#endif /* std C */
/* /////////////////////////////////////////////////////////////////////////
* Inline assembler
*/
#if !defined(_MSC_VER)
# define STSLSOFT_INLINE_ASM_SUPPORTED
# define STSLSOFT_ASM_IN_INLINE_SUPPORTED
#endif /* !_MSC_VER */
/* /////////////////////////////////////////////////////////////////////////
* inline support
*/
#define STLSOFT_CF_C99_INLINE
/* /////////////////////////////////////////////////////////////////////////
* Compiler warning suppression
*/
/* ///////////////////////////// end of file //////////////////////////// */