00001 /* ///////////////////////////////////////////////////////////////////////// 00002 * File: stlsoft/internal/cccap/unknown.h 00003 * 00004 * Purpose: Compiler feature discrimination for unknown compilers. 00005 * 00006 * Created: 7th February 2003 00007 * Updated: 14th February 2010 00008 * 00009 * Home: http://stlsoft.org/ 00010 * 00011 * Copyright (c) 2003-2010, Matthew Wilson and Synesis Software 00012 * All rights reserved. 00013 * 00014 * Redistribution and use in source and binary forms, with or without 00015 * modification, are permitted provided that the following conditions are met: 00016 * 00017 * - Redistributions of source code must retain the above copyright notice, this 00018 * list of conditions and the following disclaimer. 00019 * - Redistributions in binary form must reproduce the above copyright notice, 00020 * this list of conditions and the following disclaimer in the documentation 00021 * and/or other materials provided with the distribution. 00022 * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of 00023 * any contributors may be used to endorse or promote products derived from 00024 * this software without specific prior written permission. 00025 * 00026 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00027 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00028 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00029 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00030 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00031 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00032 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00033 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00034 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00035 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00036 * POSSIBILITY OF SUCH DAMAGE. 00037 * 00038 * ////////////////////////////////////////////////////////////////////// */ 00039 00040 00041 #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT 00042 # error This file must not be included independently of stlsoft/stlsoft.h 00043 #endif /* !STLSOFT_INCL_STLSOFT_H_STLSOFT */ 00044 00051 #ifdef STLSOFT_INCL_H_STLSOFT_CCCAP_UNKNOWN 00052 # error This file cannot be included more than once in any compilation unit 00053 #endif /* STLSOFT_INCL_H_STLSOFT_CCCAP_UNKNOWN */ 00054 00055 /* ////////////////////////////////////////////////////////////////////// */ 00056 00057 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION 00058 # define STLSOFT_VER_H_STLSOFT_CCCAP_UNKNOWN_MAJOR 3 00059 # define STLSOFT_VER_H_STLSOFT_CCCAP_UNKNOWN_MINOR 16 00060 # define STLSOFT_VER_H_STLSOFT_CCCAP_UNKNOWN_REVISION 2 00061 # define STLSOFT_VER_H_STLSOFT_CCCAP_UNKNOWN_EDIT 67 00062 #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */ 00063 00064 /* ///////////////////////////////////////////////////////////////////////// 00065 * Auto-generation and compatibility 00066 */ 00067 00068 /* 00069 [<[STLSOFT-AUTO:NO-DOCFILELABEL]>] 00070 [<[STLSOFT-AUTO:NO-UNITTEST]>] 00071 */ 00072 00073 /* ///////////////////////////////////////////////////////////////////////// 00074 * Pre-processing features 00075 */ 00076 00077 /* Messaging 00078 */ 00079 00080 /* #define STLSOFT_CF_PRAGMA_MESSAGE_SUPPORT */ 00081 00082 /* Support for #pragma once 00083 */ 00084 00085 /* #define STLSOFT_CF_PRAGMA_ONCE_SUPPORT */ 00086 00087 /* Support for __FUNCTION__ 00088 */ 00089 00090 /* #define STLSOFT_CF_FUNCTION_SYMBOL_SUPPORT */ 00091 00092 /* ///////////////////////////////////////////////////////////////////////// 00093 * C/C++ Language features 00094 */ 00095 00096 /* Variadic Macros 00097 */ 00098 00099 #define STLSOFT_CF_SUPPORTS_VARIADIC_MACROS 00100 00101 /* Anonymous unions 00102 */ 00103 #define STLSOFT_CF_ANONYMOUS_UNION_SUPPORT 00104 00105 /* "return void;" 00106 */ 00107 #define STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID 00108 00109 /* ///////////////////////////////////////////////////////////////////////// 00110 * Types 00111 */ 00112 00113 /* bool */ 00114 #ifdef __cplusplus 00115 # define STLSOFT_CF_NATIVE_BOOL_SUPPORT 00116 #endif /* __cplusplus */ 00117 00118 /* wchar_t */ 00119 #define STLSOFT_CF_NATIVE_WCHAR_T_SUPPORT 00120 00121 /* ////////////////////////////////////////////////////////////////////// */ 00122 /* ////////////////////////////////////////////////////////////////////// */ 00123 /* ////////////////////////////////////////////////////////////////////// */ 00124 /* ////////////////////////////////////////////////////////////////////// */ 00125 /* ////////////////////////////////////////////////////////////////////// */ 00126 /* ////////////////////////////////////////////////////////////////////// */ 00127 /* ////////////////////////////////////////////////////////////////////// */ 00128 /* ////////////////////////////////////////////////////////////////////// */ 00129 /* ////////////////////////////////////////////////////////////////////// */ 00130 /* ////////////////////////////////////////////////////////////////////// */ 00131 00132 /* /////////////////////////////////////////////// 00133 * Integral types 00134 * 00135 * The purpose of this section is to define the following types: 00136 * 00137 * - 8-bit signed and unsigned integers 00138 * - 16-bit signed and unsigned integers 00139 * - 32-bit signed and unsigned integers 00140 * - (optionally) 64-bit signed and unsigned integers 00141 * 00142 * and to define, where appropriate the following symbols (used for 00143 * overloading): 00144 * 00145 * - STLSOFT_CF_CHAR_DISTINCT_INT_TYPE 00146 * - STLSOFT_CF_SHORT_DISTINCT_INT_TYPE 00147 * - STLSOFT_CF_INT_DISTINCT_INT_TYPE 00148 * - STLSOFT_CF_LONG_DISTINCT_INT_TYPE 00149 * - STLSOFT_CF_LONG_LONG_DISTINCT_INT_TYPE 00150 * 00151 * which indicate that a given type is not used in the size-specific types. 00152 */ 00153 00154 #if defined(__LP64__) 00155 # define _STLSOFT_SIZEOF_CHAR (1) 00156 # define _STLSOFT_SIZEOF_SHORT (2) 00157 # define _STLSOFT_SIZEOF_INT (4) 00158 # define _STLSOFT_SIZEOF_LONG (8) 00159 # define _STLSOFT_SIZEOF_LONG_LONG (8) 00160 #else /* ? data model */ 00161 # define _STLSOFT_SIZEOF_CHAR (1) 00162 # define _STLSOFT_SIZEOF_SHORT (2) 00163 # define _STLSOFT_SIZEOF_INT (4) 00164 # define _STLSOFT_SIZEOF_LONG (4) 00165 # define _STLSOFT_SIZEOF_LONG_LONG (8) 00166 #endif /* data model */ 00167 00168 /* 8-bit integer */ 00169 #define STLSOFT_CF_8BIT_INT_SUPPORT 00170 #define STLSOFT_SI08_T_BASE_TYPE signed char 00171 #define STLSOFT_UI08_T_BASE_TYPE unsigned char 00172 00173 /* 16-bit integer */ 00174 #define STLSOFT_CF_16BIT_INT_SUPPORT 00175 #define STLSOFT_SI16_T_BASE_TYPE signed short 00176 #define STLSOFT_UI16_T_BASE_TYPE unsigned short 00177 00178 /* 32-bit integer */ 00179 #define STLSOFT_CF_32BIT_INT_SUPPORT 00180 #define STLSOFT_SI32_T_BASE_TYPE signed int 00181 #define STLSOFT_UI32_T_BASE_TYPE unsigned int 00182 #define STLSOFT_CF_LONG_DISTINCT_INT_TYPE 00183 00184 /* 64-bit integer */ 00185 #define STLSOFT_CF_64BIT_INT_SUPPORT 00186 #define STLSOFT_SI64_T_BASE_TYPE signed long long 00187 #define STLSOFT_UI64_T_BASE_TYPE unsigned long long 00188 00189 00190 /* ///////////////////////////////////////////////////////////////////////// 00191 * C++ Language Features 00192 */ 00193 00194 /* /////////////////////////////////////////////// 00195 * Miscellaneous 00196 */ 00197 00198 /* Does the compiler support Argument-Dependent Lookup? */ 00199 #define STLSOFT_CF_ADL_LOOKUP_SUPPORT 00200 00201 /* /////////////////////////////////////////////// 00202 * Static array size determination 00203 */ 00204 #define STLSOFT_CF_STATIC_ARRAY_SIZE_DETERMINATION_SUPPORT 00205 00206 /* /////////////////////////////////////////////// 00207 * C++-98 keywords support 00208 */ 00209 00210 #define STLSOFT_CF_EXPLICIT_KEYWORD_SUPPORT 00211 00212 #define STLSOFT_CF_MUTABLE_KEYWORD_SUPPORT 00213 00214 #define STLSOFT_CF_TYPENAME_PARAM_KEYWORD_SUPPORT 00215 00216 #define STLSOFT_CF_TYPENAME_TYPE_KEYWORD_SUPPORT 00217 00218 #define STLSOFT_CF_TYPENAME_TYPE_DEF_KEYWORD_SUPPORT 00219 00220 #define STLSOFT_CF_TYPENAME_TYPE_MIL_KEYWORD_SUPPORT 00221 00222 #define STLSOFT_CF_TYPENAME_TYPE_RET_KEYWORD_SUPPORT 00223 00224 /* /////////////////////////////////////////////// 00225 * RTTI support 00226 */ 00227 00228 #ifdef __cplusplus 00229 # define STLSOFT_CF_RTTI_SUPPORT 00230 #endif /* __cplusplus */ 00231 00232 /* /////////////////////////////////////////////// 00233 * Exception support 00234 */ 00235 00236 #ifdef __cplusplus 00237 # define STLSOFT_CF_EXCEPTION_SUPPORT 00238 #endif /* __cplusplus */ 00239 00240 #define STLSOFT_CF_EXCEPTION_SIGNATURE_SUPPORT 00241 00242 /* #define STLSOFT_CF_EXCEPTION_SPEC_EXPENSIVE */ 00243 00244 #define STLSOFT_CF_THROW_BAD_ALLOC 00245 00246 /* /////////////////////////////////////////////// 00247 * Namespace support 00248 */ 00249 00250 /* Can the compiler support namespaces? */ 00251 #ifdef __cplusplus 00252 # define STLSOFT_CF_NAMESPACE_SUPPORT 00253 #endif /* __cplusplus */ 00254 00255 /* Should we allow the STLSoft libraries to be defined within a namespace? */ 00256 /* #define _STLSOFT_NO_NAMESPACES */ 00257 00258 /* Does the C++ standard library exist within the std namespace */ 00259 /* TODO: Move this out of here, and change to STLSOFT_LF_std_NAMESPACE */ 00260 #define STLSOFT_CF_std_NAMESPACE 00261 00262 00263 00264 00265 /* */ 00266 #define STLSOFT_CF_FUNCTION_SIGNATURE_FULL_ARG_QUALIFICATION_REQUIRED 00267 00268 /* Template support */ 00269 #define STLSOFT_CF_TEMPLATE_SUPPORT 00270 00271 /* #define STLSOFT_CF_TEMPLATE_TYPE_REQUIRED_IN_ARGS */ 00272 00273 #define STLSOFT_CF_TEMPLATE_CLASS_DEFAULT_FUNDAMENTAL_ARGUMENT_SUPPORT 00274 00275 #define STLSOFT_CF_TEMPLATE_CLASS_DEFAULT_CLASS_ARGUMENT_SUPPORT 00276 00277 #define STLSOFT_CF_MEM_FUNC_AS_TEMPLATE_PARAM_SUPPORT 00278 00279 #define STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT 00280 00281 #define STLSOFT_CF_MEMBER_TEMPLATE_OVERLOAD_DISCRIMINATED 00282 00283 #define STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT 00284 00285 #define STLSOFT_CF_MEMBER_TEMPLATE_CTOR_OVERLOAD_DISCRIMINATED 00286 00287 #define STLSOFT_CF_MEMBER_TEMPLATE_RANGE_METHOD_SUPPORT 00288 00289 #define STLSOFT_CF_MEMBER_TEMPLATE_CLASS_SUPPORT 00290 00291 #define STLSOFT_CF_TEMPLATE_SPECIALISATION_SYNTAX 00292 00293 #define STLSOFT_CF_TEMPLATE_PARTIAL_SPECIALISATION_SUPPORT 00294 00295 #define STLSOFT_CF_TEMPLATE_OUTOFCLASSFN_QUALIFIED_TYPE_SUPPORT 00296 00297 #define STLSOFT_CF_std_char_traits_AVAILABLE 00298 00299 #define STLSOFT_CF_PARENT_TYPES_CAN_BE_USED_IN_NON_TEMPLATE 00300 00301 #define STLSOFT_CF_PARENT_TYPES_CAN_BE_USED_IN_TEMPLATE 00302 00303 #define STLSOFT_CF_TEMPLATE_QUALIFIER_KEYWORD_SUPPORT 00304 00305 #define STLSOFT_CF_TEMPLATE_TEMPLATE_SUPPORT 00306 00307 /* #define STLSOFT_CF_MOVE_CONSTRUCTOR_SUPPORT */ 00308 00309 #define STLSOFT_CF_VENEER_SUPPORT 00310 00311 /* #define STLSOFT_CF_ALLOCATOR_BASE_EXPENSIVE */ 00312 00313 /* #define STLSOFT_CF_COMPILER_WARNS_NO_PUBLIC_DTOR */ 00314 00315 00316 00317 /* Shims are assumed to be supported. */ 00318 /* #define STLSOFT_CF_TEMPLATE_SHIMS_NOT_SUPPORTED */ 00319 00320 /* This cannot be assumed. */ 00321 /* #define STLSOFT_CF_NEGATIVE_MODULUS_POSITIVE_GIVES_NEGATIVE_RESULT */ 00322 00323 /* 00324 * class X 00325 * { 00326 * #ifdef STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT 00327 * private: 00328 * struct boolean { int i; }; 00329 * public: 00330 * operator int boolean::* () const 00331 * { 00332 * return <internal condition> ? &boolean::i : NULL; 00333 * } 00334 * #else // ? STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT 00335 * public: 00336 * operator bool() const 00337 * { 00338 * return <internal condition>; 00339 * } 00340 * #endif // STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT 00341 * #if !defined(STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT) || \ 00342 * !defined(STLSOFT_CF_OPERATOR_NOT_VIA_OPERATOR_POINTER_TO_MEMBER_SUPPORT) 00343 * public: 00344 * bool operator !() const 00345 * { 00346 * # ifdef STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT 00347 * return NULL == operator int boolean::*(); 00348 * # else // ? STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT 00349 * return !operator bool(); 00350 * # endif // STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT 00351 * } 00352 * #endif // !STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT || !STLSOFT_CF_OPERATOR_NOT_VIA_OPERATOR_POINTER_TO_MEMBER_SUPPORT 00353 * 00354 */ 00355 00356 /* These cannot be assumed. */ 00357 00358 /* #define STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT */ 00359 /* #define STLSOFT_CF_OPERATOR_NOT_VIA_OPERATOR_POINTER_TO_MEMBER_SUPPORT */ 00360 00361 #define STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT 00362 /* #define STLSOFT_CF_OPERATOR_NOT_VIA_OPERATOR_POINTER_TO_MEMBER_SUPPORT */ 00363 00364 00365 /* ///////////////////////////////////////////////////////////////////////// 00366 * Quality assurance features 00367 */ 00368 00369 /* Dynamic assert: 00370 */ 00371 00372 #if defined(_STLSOFT_CUSTOM_ASSERT) 00373 /* You have defined the pre-processor symbol _STLSOFT_CUSTOM_ASSERT, 00374 * which stipulates that you will be providing your own assert. This 00375 * requires that you have defined _STLSOFT_CUSTOM_ASSERT() as a macro 00376 * taking 1 parameter (the condition to assert). 00377 * 00378 * Suppose you have a function DisplayAssert_(), which has the 00379 * following signature: 00380 * 00381 * void DisplayAssert_(char const* file, int line, char const* expression); 00382 * 00383 * Presumably you would also have your own assert macro, say MY_ASSERT(), 00384 * defined as: 00385 * 00386 * #define MY_ASSERT(_x) ((void)((!(_x)) ? ((void)(DisplayAssert_(__FILE__, __LINE__, #_x))) : ((void)0))) 00387 * 00388 * so you would simply need to define _STLSOFT_CUSTOM_ASSERT() in terms of 00389 * MY_ASSERT(), as in: 00390 * 00391 * #define _STLSOFT_CUSTOM_ASSERT(_x) MY_ASSERT(_x) 00392 * 00393 * where 00394 */ 00395 # define __STLSOFT_CF_ASSERT_SUPPORT 00396 # define STLSOFT_CF_ASSERT_SUPPORT 00397 # define STLSOFT_ASSERT(_x) _STLSOFT_CUSTOM_ASSERT(_x) 00398 # if defined(_STLSOFT_CUSTOM_ASSERT_INCLUDE) 00399 # define __STLSOFT_CF_ASSERT_INCLUDE_NAME _STLSOFT_CUSTOM_ASSERT_INCLUDE 00400 # else 00401 # error You must define _STLSOFT_CUSTOM_ASSERT_INCLUDE along with _STLSOFT_CUSTOM_ASSERT() 00402 # endif /* !_STLSOFT_CUSTOM_ASSERT_INCLUDE */ 00403 #else /* ? _STLSOFT_CUSTOM_ASSERT */ 00404 # define __STLSOFT_CF_ASSERT_SUPPORT 00405 # define STLSOFT_CF_ASSERT_SUPPORT 00406 # define __STLSOFT_CF_USE_cassert 00407 #endif /* _STLSOFT_CUSTOM_ASSERT */ 00408 00409 /* Static assert: 00410 */ 00411 00412 #define STLSOFT_CF_STATIC_ASSERT_SUPPORT 00413 00414 /* TODO: define here whether need -1 or 0 as the static assert invalid array quantifier */ 00415 00416 /* ///////////////////////////////////////////////////////////////////////// 00417 * Calling convention 00418 */ 00419 00420 #define STLSOFT_CF_CDECL_SUPPORTED 00421 /* #define STLSOFT_CF_FASTCALL_SUPPORTED */ 00422 /* #define STLSOFT_CF_STDCALL_SUPPORTED */ 00423 00424 #define STLSOFT_CDECL 00425 00426 /* #define STLSOFT_CDECL __cdecl */ 00427 /* #define STLSOFT_FASTCALL __fastcall */ 00428 /* #define STLSOFT_STDCALL __stdcall */ 00429 00430 /* ///////////////////////////////////////////////////////////////////////// 00431 * Inline assembler 00432 */ 00433 00434 /* #define STSLSOFT_INLINE_ASM_SUPPORTED */ 00435 /* #define STSLSOFT_ASM_IN_INLINE_SUPPORTED */ 00436 00437 /* ///////////////////////////////////////////////////////////////////////// 00438 * inline support 00439 */ 00440 00441 #if defined(_WIN32) && \ 00442 defined(_MSC_VER) 00443 /* Special case when "forcing" any compiler on Win32 using VC++ in order 00444 * to emulate UNIX compilation 00445 */ 00446 # define STLSOFT_CUSTOM_C_INLINE __inline 00447 #else /* ? environment */ 00448 # define STLSOFT_CF_C99_INLINE 00449 #endif /* environment */ 00450 00451 /* ///////////////////////////////////////////////////////////////////////// 00452 * Compiler warning suppression 00453 */ 00454 00455 /* ///////////////////////////// end of file //////////////////////////// */