00001 /* ///////////////////////////////////////////////////////////////////////// 00002 * File: stlsoft/internal/cccap/watcom.h 00003 * 00004 * Purpose: Compiler feature discrimination for Watcom C/C++. 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_WATCOM 00052 # error This file cannot be included more than once in any compilation unit 00053 #endif /* STLSOFT_INCL_H_STLSOFT_CCCAP_WATCOM */ 00054 00055 /* ////////////////////////////////////////////////////////////////////// */ 00056 00057 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION 00058 # define STLSOFT_VER_H_STLSOFT_CCCAP_WATCOM_MAJOR 3 00059 # define STLSOFT_VER_H_STLSOFT_CCCAP_WATCOM_MINOR 18 00060 # define STLSOFT_VER_H_STLSOFT_CCCAP_WATCOM_REVISION 2 00061 # define STLSOFT_VER_H_STLSOFT_CCCAP_WATCOM_EDIT 78 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 * Compiler features 00075 */ 00076 00077 /* Messaging 00078 */ 00079 00080 #define STLSOFT_CF_PRAGMA_MESSAGE_SUPPORT 00081 00082 /* Support for #pragma once 00083 */ 00084 00085 #if __WATCOMC__ >= 1200 00086 # define STLSOFT_CF_PRAGMA_ONCE_SUPPORT 00087 #endif /* __WATCOMC__ */ 00088 00089 /* Support for __FUNCTION__ 00090 */ 00091 00092 #if __WATCOMC__ >= 1240 00093 # define STLSOFT_CF_FUNCTION_SYMBOL_SUPPORT 00094 #endif /* __WATCOMC__ */ 00095 00096 /* Variadic Macros 00097 */ 00098 00099 #if __WATCOMC__ >= 1240 00100 # define STLSOFT_CF_SUPPORTS_VARIADIC_MACROS 00101 #endif /* __WATCOMC__ */ 00102 00103 /* Types: 00104 */ 00105 00106 /* bool */ 00107 #ifdef __cplusplus 00108 # define STLSOFT_CF_NATIVE_BOOL_SUPPORT 00109 #endif /* __cplusplus */ 00110 00111 /* char (sign) */ 00112 #ifndef __CHAR_SIGNED__ 00113 # define STLSOFT_CF_CHAR_IS_UNSIGNED 00114 #endif /* !__CHAR_SIGNED__ */ 00115 00116 /* wchar_t */ 00117 #if __WATCOMC__ >= 1200 00118 # define STLSOFT_CF_NATIVE_WCHAR_T_SUPPORT 00119 #endif /* __WATCOMC__ */ 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 #elif defined(_WIN32) || \ 00161 defined(_WIN64) 00162 # define _STLSOFT_SIZEOF_CHAR (1) 00163 # define _STLSOFT_SIZEOF_SHORT (2) 00164 # define _STLSOFT_SIZEOF_INT (4) 00165 # define _STLSOFT_SIZEOF_LONG (4) 00166 # define _STLSOFT_SIZEOF_LONG_LONG (8) 00167 #else /* ? data model */ 00168 # error Use of Watcom C/C++ has not been verified on any operation system other than Win32. Please contact Synesis Software 00169 #endif /* data model */ 00170 00171 /* 8-bit integer */ 00172 #define STLSOFT_CF_8BIT_INT_SUPPORT 00173 #define STLSOFT_SI08_T_BASE_TYPE signed char 00174 #define STLSOFT_UI08_T_BASE_TYPE unsigned char 00175 00176 /* 16-bit integer */ 00177 #define STLSOFT_CF_16BIT_INT_SUPPORT 00178 #define STLSOFT_SI16_T_BASE_TYPE signed short 00179 #define STLSOFT_UI16_T_BASE_TYPE unsigned short 00180 00181 /* 32-bit integer */ 00182 #define STLSOFT_CF_32BIT_INT_SUPPORT 00183 #define STLSOFT_SI32_T_BASE_TYPE signed int 00184 #define STLSOFT_UI32_T_BASE_TYPE unsigned int 00185 #define STLSOFT_CF_LONG_DISTINCT_INT_TYPE 00186 00187 /* 64-bit integer */ 00188 #define STLSOFT_CF_64BIT_INT_SUPPORT 00189 #define STLSOFT_CF_64BIT_INT_IS_long_long 00190 #define STLSOFT_SI64_T_BASE_TYPE signed long long 00191 #define STLSOFT_UI64_T_BASE_TYPE unsigned long long 00192 00193 00194 00195 /* Member constants */ 00196 /* #define STLSOFT_CF_MEMBER_CONSTANT_SUPPORT */ 00197 00198 /* Static assertions */ 00199 #define STLSOFT_CF_STATIC_ASSERT_SUPPORT 00200 00201 /* RTTI support */ 00202 #if defined(_CPPRTTI) || \ 00203 defined(__CPPRTTI) 00204 # define STLSOFT_CF_RTTI_SUPPORT 00205 #else 00206 /* Not defined */ 00207 #endif /* __CPPUNWIND */ 00208 00209 /* Exception support */ 00210 #if defined(_CPPUNWIND) || \ 00211 defined(__CPPUNWIND) 00212 # define STLSOFT_CF_EXCEPTION_SUPPORT 00213 #else 00214 /* Not defined */ 00215 #endif /* __CPPUNWIND */ 00216 00217 /* */ 00218 #define STLSOFT_CF_FUNCTION_SIGNATURE_FULL_ARG_QUALIFICATION_REQUIRED 00219 00220 /* Namespace support */ 00221 /* Watcom C/C++ gets confused when declaring ::stlsoft::X, so namespaces are 00222 * suppressed. 00223 */ 00224 #if __WATCOMC__ < 1240 00225 # define _STLSOFT_NO_NAMESPACES 00226 #endif /* __WATCOMC__ */ 00227 00228 #ifdef __cplusplus 00229 # define STLSOFT_CF_NAMESPACE_SUPPORT 00230 #endif /* __cplusplus */ 00231 00232 #define STLSOFT_CF_ANONYMOUS_UNION_SUPPORT 00233 00234 /* #define STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */ 00235 00236 /* Template support */ 00237 #define STLSOFT_CF_TEMPLATE_SUPPORT 00238 00239 #define STLSOFT_CF_TEMPLATE_TYPE_REQUIRED_IN_ARGS 00240 00241 #ifdef __CPPUNWIND 00242 # define STLSOFT_CF_EXCEPTION_SIGNATURE_SUPPORT 00243 #else 00244 /* Not defined */ 00245 #endif /* __CPPUNWIND */ 00246 00247 /* #define STLSOFT_CF_EXCEPTION_SPEC_EXPENSIVE */ 00248 00249 00250 /* #define STLSOFT_CF_THROW_BAD_ALLOC */ 00251 00252 #if __WATCOMC__ >= 1200 00253 # define STLSOFT_CF_TEMPLATE_CLASS_DEFAULT_FUNDAMENTAL_ARGUMENT_SUPPORT 00254 #endif /* __WATCOMC__ */ 00255 00256 #if __WATCOMC__ >= 1270 00257 # define STLSOFT_CF_TEMPLATE_CLASS_DEFAULT_CLASS_ARGUMENT_SUPPORT 00258 #endif /* __WATCOMC__ */ 00259 00260 /* # define STLSOFT_CF_TEMPLATE_FUNCTION_FUNDAMENTAL_ARGUMENT_SUPPORT */ 00261 00262 /* #define STLSOFT_CF_MEM_FUNC_AS_TEMPLATE_PARAM_SUPPORT */ 00263 00264 /* #define STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT */ 00265 00266 /* #define STLSOFT_CF_MEMBER_TEMPLATE_OVERLOAD_DISCRIMINATED */ 00267 00268 /* #define STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT */ 00269 00270 /* #define STLSOFT_CF_MEMBER_TEMPLATE_CTOR_OVERLOAD_DISCRIMINATED */ 00271 00272 /* #define STLSOFT_CF_MEMBER_TEMPLATE_RANGE_METHOD_SUPPORT */ 00273 00274 /* #define STLSOFT_CF_MEMBER_TEMPLATE_CLASS_SUPPORT */ 00275 00276 /* #define STLSOFT_CF_TEMPLATE_SPECIALISATION_SYNTAX */ 00277 00278 /* #define STLSOFT_CF_TEMPLATE_PARTIAL_SPECIALISATION_SUPPORT */ 00279 00280 # ifdef STLSOFT_CF_TEMPLATE_OUTOFCLASSFN_QUALIFIED_TYPE_SUPPORT 00281 # undef STLSOFT_CF_TEMPLATE_OUTOFCLASSFN_QUALIFIED_TYPE_SUPPORT 00282 # endif /* STLSOFT_CF_TEMPLATE_OUTOFCLASSFN_QUALIFIED_TYPE_SUPPORT */ 00283 00284 #if __WATCOMC__ >= 1240 00285 # define STLSOFT_CF_std_NAMESPACE 00286 #endif /* __WATCOMC__ */ 00287 00288 #define STLSOFT_CF_std_char_traits_AVAILABLE 00289 00290 /* #define STLSOFT_CF_PARENT_TYPES_CAN_BE_USED_IN_NON_TEMPLATE */ 00291 00292 /* #define STLSOFT_CF_PARENT_TYPES_CAN_BE_USED_IN_TEMPLATE */ 00293 00294 #define STLSOFT_CF_EXPLICIT_KEYWORD_SUPPORT 00295 00296 #define STLSOFT_CF_MUTABLE_KEYWORD_SUPPORT 00297 00298 /* #define STLSOFT_CF_TYPENAME_PARAM_KEYWORD_SUPPORT */ 00299 00300 /* #define STLSOFT_CF_TYPENAME_TYPE_KEYWORD_SUPPORT */ 00301 00302 /* #define STLSOFT_CF_TYPENAME_TYPE_DEF_KEYWORD_SUPPORT */ 00303 00304 /* #define STLSOFT_CF_TYPENAME_TYPE_MIL_KEYWORD_SUPPORT */ 00305 00306 /* #define STLSOFT_CF_TYPENAME_TYPE_RET_KEYWORD_SUPPORT */ 00307 00308 /* #define STLSOFT_CF_TEMPLATE_QUALIFIER_KEYWORD_SUPPORT */ 00309 00310 /* #define STLSOFT_CF_MOVE_CONSTRUCTOR_SUPPORT */ 00311 00312 /* #define STLSOFT_CF_ADL_LOOKUP_SUPPORT */ 00313 00314 /* #define STLSOFT_CF_TEMPLATE_TEMPLATE_SUPPORT */ 00315 00316 /* #define STLSOFT_CF_STATIC_ARRAY_SIZE_DETERMINATION_SUPPORT */ 00317 00318 #define STLSOFT_CF_VENEER_SUPPORT 00319 00320 #define STLSOFT_CF_ALLOCATOR_BASE_EXPENSIVE 00321 00322 /* #define STLSOFT_CF_COMPILER_WARNS_NO_PUBLIC_DTOR */ 00323 00324 #define STLSOFT_CF_TEMPLATE_SHIMS_NOT_SUPPORTED 00325 00326 #define STLSOFT_CF_NEGATIVE_MODULUS_POSITIVE_GIVES_NEGATIVE_RESULT 00327 00328 #define STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT 00329 /* #define STLSOFT_CF_OPERATOR_NOT_VIA_OPERATOR_POINTER_TO_MEMBER_SUPPORT */ 00330 00331 /* ///////////////////////////////////////////////////////////////////////// 00332 * Quality assurance features 00333 */ 00334 00335 #if defined(_STLSOFT_CUSTOM_ASSERT) 00336 /* You have defined the pre-processor symbol _STLSOFT_CUSTOM_ASSERT, 00337 * which stipulates that you will be providing your own assert. This 00338 * requires that you have defined _STLSOFT_CUSTOM_ASSERT() as a macro 00339 * taking 1 parameter (the condition to assert). 00340 * 00341 * Suppose you have a function _DisplayAssert(), which has the 00342 * following signature: 00343 * 00344 * void _DisplayAssert(char const* file, int line, char const* expression); 00345 * 00346 * Presumably you would also have your own assert macro, say MY_ASSERT(), 00347 * defined as: 00348 * 00349 * #define MY_ASSERT(_x) ((void)((!(_x)) ? ((void)(_DisplayAssert(__FILE__, __LINE__, #_x))) : ((void)0))) 00350 * 00351 * so you would simply need to define _STLSOFT_CUSTOM_ASSERT() in terms of 00352 * MY_ASSERT(), as in: 00353 * 00354 * #define _STLSOFT_CUSTOM_ASSERT(_x) MY_ASSERT(_x) 00355 * 00356 * You must also specify the include header name containing your 00357 * custom assertion declaration, in the preprocessor symbol 00358 * _STLSOFT_CUSTOM_ASSERT_INCLUDE 00359 */ 00360 # define __STLSOFT_CF_ASSERT_SUPPORT 00361 # define STLSOFT_CF_ASSERT_SUPPORT 00362 # define STLSOFT_ASSERT(_x) _STLSOFT_CUSTOM_ASSERT(_x) 00363 # if defined(_STLSOFT_CUSTOM_ASSERT_INCLUDE) 00364 # define __STLSOFT_CF_ASSERT_INCLUDE_NAME _STLSOFT_CUSTOM_ASSERT_INCLUDE 00365 # else 00366 # error You must define _STLSOFT_CUSTOM_ASSERT_INCLUDE along with _STLSOFT_CUSTOM_ASSERT() 00367 # endif /* !_STLSOFT_CUSTOM_ASSERT_INCLUDE */ 00368 #else /* ? _STLSOFT_CUSTOM_ASSERT */ 00369 # define __STLSOFT_CF_ASSERT_SUPPORT 00370 # define STLSOFT_CF_ASSERT_SUPPORT 00371 # define __STLSOFT_CF_ASSERT_INCLUDE_NAME <assert.h> 00372 # define STLSOFT_ASSERT(_x) assert(_x) 00373 #endif /* _STLSOFT_CUSTOM_ASSERT */ 00374 00375 /* ///////////////////////////////////////////////////////////////////////// 00376 * Calling convention 00377 */ 00378 00379 #define STLSOFT_CF_THISCALL_SUPPORTED 00380 #define STLSOFT_CF_CDECL_SUPPORTED 00381 #define STLSOFT_CF_STDCALL_SUPPORTED 00382 00383 #ifdef STLSOFT_CF_CDECL_SUPPORTED 00384 # define STLSOFT_CDECL __cdecl 00385 #endif /* STLSOFT_CF_CDECL_SUPPORTED */ 00386 #ifdef STLSOFT_CF_STDCALL_SUPPORTED 00387 # define STLSOFT_STDCALL __stdcall 00388 #endif /* STLSOFT_CF_STDCALL_SUPPORTED */ 00389 00390 /* ///////////////////////////////////////////////////////////////////////// 00391 * Inline assembler 00392 */ 00393 00394 #define STSLSOFT_INLINE_ASM_SUPPORTED 00395 /* #define STSLSOFT_ASM_IN_INLINE_SUPPORTED - must use static */ 00396 00397 /* ///////////////////////////////////////////////////////////////////////// 00398 * inline support 00399 */ 00400 00401 #define STLSOFT_CF_C99_INLINE 00402 00403 /* ///////////////////////////////////////////////////////////////////////// 00404 * Compiler warning suppression 00405 */ 00406 00407 #pragma warning 14 10 /* Suppresses "Warning! W014: no reference to symbol ..." */ 00408 #pragma warning 472 10 /* Suppresses "Warning! W472: expression with side effect in 'sizeof' discarded" */ 00409 #pragma warning 555 10 /* Suppresses "Warning! W555: expression for 'while' is always false" */ 00410 #pragma warning 594 10 /* Suppresses "Warning! W594: construct resolved as a declaration/type" */ 00411 #pragma warning 604 10 /* Suppresses "Warning! W604: must look ahead to determine whether construct is a declaration/type or an expression" */ 00412 00413 /* ///////////////////////////// end of file //////////////////////////// */