You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

866 lines
26 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: stlsoft/internal/cccap/msvc.h
  3. *
  4. * Purpose: Compiler feature discrimination for Visual C++.
  5. *
  6. * Created: 7th February 2003
  7. * Updated: 30th July 2012
  8. *
  9. * Thanks: To Cludio Albuquerque for working on the
  10. * Win64-compatibility.
  11. *
  12. * Home: http://stlsoft.org/
  13. *
  14. * Copyright (c) 2003-2012, Matthew Wilson and Synesis Software
  15. * All rights reserved.
  16. *
  17. * Redistribution and use in source and binary forms, with or without
  18. * modification, are permitted provided that the following conditions are met:
  19. *
  20. * - Redistributions of source code must retain the above copyright notice, this
  21. * list of conditions and the following disclaimer.
  22. * - Redistributions in binary form must reproduce the above copyright notice,
  23. * this list of conditions and the following disclaimer in the documentation
  24. * and/or other materials provided with the distribution.
  25. * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
  26. * any contributors may be used to endorse or promote products derived from
  27. * this software without specific prior written permission.
  28. *
  29. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  30. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  31. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  32. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  33. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  34. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  35. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  36. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  37. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  38. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  39. * POSSIBILITY OF SUCH DAMAGE.
  40. *
  41. * ////////////////////////////////////////////////////////////////////// */
  42. #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
  43. # error This file must not be included independently of stlsoft/stlsoft.h
  44. #endif /* !STLSOFT_INCL_STLSOFT_H_STLSOFT */
  45. /** \file stlsoft/internal/cccap/msvc.h
  46. *
  47. * Compiler feature discrimination for Visual C++
  48. * (\ref group__library__internal).
  49. */
  50. #ifdef STLSOFT_INCL_H_STLSOFT_CCCAP_MSVC
  51. # error This file cannot be included more than once in any compilation unit
  52. #endif /* STLSOFT_INCL_H_STLSOFT_CCCAP_MSVC */
  53. #ifndef STLSOFT_COMPILER_IS_MSVC
  54. # error This file has been erroneously included for a compiler other than Visual C++
  55. #endif /* compiler */
  56. /* ////////////////////////////////////////////////////////////////////// */
  57. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  58. # define STLSOFT_VER_H_STLSOFT_CCCAP_MSVC_MAJOR 3
  59. # define STLSOFT_VER_H_STLSOFT_CCCAP_MSVC_MINOR 25
  60. # define STLSOFT_VER_H_STLSOFT_CCCAP_MSVC_REVISION 1
  61. # define STLSOFT_VER_H_STLSOFT_CCCAP_MSVC_EDIT 121
  62. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  63. /* /////////////////////////////////////////////////////////////////////////
  64. * Structure:
  65. *
  66. * - auto-generation and compatibility
  67. * - preprocessor features
  68. * - support for built-in types
  69. * - built-in type characteristics
  70. * - support for C/C++ language features
  71. * - support for C language features
  72. * - support for C++ language features - 1
  73. * - support for C++ language features - 2
  74. * - inline assembler
  75. * - calling convention
  76. * - integer sizes
  77. * - size-specific integer types
  78. * - still to-be-determined features
  79. * - assertions
  80. * - compiler warning suppression
  81. * - obsolete features
  82. */
  83. /* /////////////////////////////////////////////////////////////////////////
  84. * Auto-generation and compatibility
  85. */
  86. /*
  87. [<[STLSOFT-AUTO:NO-DOCFILELABEL]>]
  88. [<[STLSOFT-AUTO:NO-UNITTEST]>]
  89. */
  90. /* /////////////////////////////////////////////////////////////////////////
  91. * Custom macros
  92. */
  93. /*
  94. * _MSC_FULL_VER is _MSC_VER * multiplying_factor + build-number
  95. *
  96. * For _MSC_VER >= 1400, the multiplying_factor is 100000; for earlier
  97. * versions (1200 - 1310) it's 10000. For 1100-, it is not defined.
  98. */
  99. #ifdef _MSC_FULL_VER
  100. # define STLSOFT_MSVC_VER _MSC_FULL_VER
  101. #else /* ? __GNUC_PATCHLEVEL__ */
  102. # if _MSC_VER < 1200
  103. # define STLSOFT_MSVC_VER (_MSC_VER * 10000)
  104. # else
  105. # define STLSOFT_MSVC_VER (_MSC_VER * 100000)
  106. # endif
  107. #endif /* __GNUC_PATCHLEVEL__ */
  108. /* /////////////////////////////////////////////////////////////////////////
  109. * Preprocessor features
  110. *
  111. * - #pragma message
  112. * - #pragma once
  113. * - __COUNTER__
  114. * - __FUNCTION__
  115. * - variadic macros
  116. */
  117. #define STLSOFT_PPF_pragma_message_SUPPORT
  118. #if _MSC_VER >= 900
  119. # define STLSOFT_PPF_pragma_once_SUPPORT
  120. #endif /* compiler */
  121. #if _MSC_VER >= 1300
  122. # define STLSOFT_PPF_COUNTER_SYMBOL_SUPPORT
  123. #endif /* compiler */
  124. #if _MSC_VER >= 1300
  125. # define STLSOFT_PPF_FUNCTION_SYMBOL_SUPPORT
  126. #endif /* compiler */
  127. #if _MSC_VER >= 1400
  128. # define STLSOFT_PPF_VARIADIC_MACROS_SUPPORT
  129. #endif /* compiler */
  130. /* /////////////////////////////////////////////////////////////////////////
  131. * Support for built-in types
  132. *
  133. * - bool
  134. * - wchar_t
  135. * - long long
  136. * - __int8
  137. * - __int16
  138. * - __int32
  139. * - __int64
  140. * - long double
  141. */
  142. #ifdef __BOOL_DEFINED
  143. # define STLSOFT_CF_BUILTIN_bool_SUPPORT
  144. #endif /* __BOOL_DEFINED */
  145. #ifdef _NATIVE_WCHAR_T_DEFINED
  146. # define STLSOFT_CF_BUILTIN_wchar_t_SUPPORT
  147. #endif /* _NATIVE_WCHAR_T_DEFINED */
  148. /*
  149. # define STLSOFT_CF_BUILTIN_long_long_SUPPORT
  150. */
  151. #define STLSOFT_CF_BUILTIN___int8_SUPPORT
  152. #define STLSOFT_CF_BUILTIN___int16_SUPPORT
  153. #define STLSOFT_CF_BUILTIN___int32_SUPPORT
  154. #if _MSC_VER >= 1020
  155. # define STLSOFT_CF_BUILTIN___int64_SUPPORT
  156. #endif /* compiler */
  157. #if _MSC_VER >= 1400
  158. # define STLSOFT_CF_BUILTIN_long_long_SUPPORT
  159. #endif /* compiler */
  160. /* /////////////////////////////////////////////////////////////////////////
  161. * Built-in type characteristics
  162. *
  163. * - char is unsigned
  164. * - wchar_t
  165. * - synthesised
  166. * - available
  167. */
  168. #ifdef _CHAR_UNSIGNED
  169. # define STLSOFT_CF_char_IS_UNSIGNED
  170. #endif /* _CHAR_UNSIGNED */
  171. #if !defined(STLSOFT_CF_BUILTIN_wchar_t_SUPPORT) && \
  172. defined(_WCHAR_T_DEFINED)
  173. # define STLSOFT_CF_wchar_t_IS_SYNTHESISED
  174. #endif /* !STLSOFT_CF_BUILTIN_wchar_t_SUPPORT && _WCHAR_T_DEFINED */
  175. /* /////////////////////////////////////////////////////////////////////////
  176. * Support for C/C++ language features
  177. *
  178. * - nullptr (C++11)
  179. * - return void
  180. * - static assertions
  181. * - anonymous unions
  182. * - -ve % +ve => -ve result
  183. *
  184. * nullptr (C++11)
  185. * ---------------
  186. *
  187. * nullptr keyword is recognised, represented by definition of the
  188. * preprocessor symbol STLSOFT_CF_BUILTIN_nullptr_SUPPORT
  189. *
  190. *
  191. * static assertions
  192. * -----------------
  193. *
  194. * Two questions:
  195. *
  196. * 1. Are STLSoft-style static assertions (see stlsoft/stlsoft.h)
  197. * supported by the compiler? This is indicated by the definition of the
  198. * preprocessor symbol STLSOFT_CF_STATIC_ASSERT_SUPPORT
  199. *
  200. * 2. Is the C++11 static_assert keyword supported? This is indicated by the
  201. * definition of the preprocessor symbol STLSOFT_CF_static_assert_SUPPORT
  202. */
  203. #if _MSC_VER >= 1600
  204. # define STLSOFT_CF_BUILTIN_nullptr_SUPPORT
  205. #endif /* compiler */
  206. #if _MSC_VER >= 1300
  207. # define STLSOFT_CF_return_void_SUPPORT
  208. #endif /* compiler */
  209. #define STLSOFT_CF_STATIC_ASSERT_SUPPORT
  210. #if _MSC_VER >= 1600
  211. # define STLSOFT_CF_static_assert_SUPPORT
  212. #endif /* compiler */
  213. #define STLSOFT_CF_ANONYMOUS_UNION_SUPPORT
  214. #define STLSOFT_CF_NEGATIVE_MODULUS_POSITIVE_GIVES_NEGATIVE_RESULT
  215. /* /////////////////////////////////////////////////////////////////////////
  216. * Support for C language features
  217. *
  218. * - inline
  219. * - C99 inline keyword
  220. * - compiler-specific keyword
  221. */
  222. /* #define STLSOFT_CF_C99_INLINE_SUPPORT */
  223. #define STLSOFT_CUSTOM_C_INLINE __inline
  224. /* /////////////////////////////////////////////////////////////////////////
  225. * Support for C++ language features - 1
  226. *
  227. * - exceptions
  228. * - exception signatures
  229. * - exception signatures expense
  230. * - operator new throws bad_alloc
  231. * - RTTI
  232. * - namespaces
  233. * - STLSoft namespace(s)?
  234. * - member constants
  235. * - explicit keyword
  236. * - mutable keyword
  237. * - template keyword
  238. * - typename keyword
  239. * - in a template parameter
  240. * - type disambiguation inside template bodies
  241. * - disambiguation in default template arguments
  242. * - type disambiguation inside initialiser lists in class template constructors
  243. * - type disambiguation the return types in templates
  244. * - argument-dependent lookup
  245. * - static array-size determination
  246. * - empty-derived optimisation
  247. * -
  248. * - empty-base optimisation
  249. * -
  250. * - move constructor support
  251. * - operators
  252. * - operator bool implemented as pointer-to-member
  253. * - operator ! implemented as pointer-to-member
  254. */
  255. #ifdef _CPPUNWIND
  256. # define STLSOFT_CF_EXCEPTION_SUPPORT
  257. # if _MSC_VER >= 1100
  258. # define STLSOFT_CF_EXCEPTION_SIGNATURE_SUPPORT
  259. # endif /* compiler */
  260. /*
  261. # define STLSOFT_CF_EXCEPTION_SPEC_EXPENSIVE
  262. */
  263. # if _MSC_VER >= 1300
  264. # define STLSOFT_CF_EXCEPTION_OPERATOR_NEW_THROWS_BAD_ALLOC
  265. # endif /* compiler */
  266. #endif /* _CPPUNWIND */
  267. #ifdef _CPPRTTI
  268. # define STLSOFT_CF_RTTI_SUPPORT
  269. #endif /* _CPPRTTI */
  270. #ifdef __cplusplus
  271. # if _MSC_VER >= 1020
  272. # define STLSOFT_CF_NAMESPACE_SUPPORT
  273. # endif /* compiler */
  274. #endif /* __cplusplus */
  275. #if _MSC_VER < 1100
  276. /* Since Visual C++ 4.2 and earlier do not correctly support using declarations
  277. * when applied to templates, it makes the use of namespaces with templates
  278. * too painful to use, so namespaces are suppressed.
  279. */
  280. # define _STLSOFT_NO_NAMESPACES
  281. #endif /* compiler */
  282. #if _MSC_VER >= 1300
  283. # define STLSOFT_CF_MEMBER_CONSTANT_SUPPORT
  284. #endif /* compiler */
  285. #if _MSC_VER >= 1100
  286. # define STLSOFT_CF_EXPLICIT_KEYWORD_SUPPORT
  287. #endif /* compiler */
  288. #if _MSC_VER >= 1100
  289. # define STLSOFT_CF_MUTABLE_KEYWORD_SUPPORT
  290. #endif /* compiler */
  291. #if _MSC_VER >= 1300
  292. # define STLSOFT_CF_TEMPLATE_QUALIFIER_KEYWORD_SUPPORT
  293. #endif /* compiler */
  294. #if _MSC_VER >= 1100
  295. # define STLSOFT_CF_TYPENAME_PARAM_KEYWORD_SUPPORT
  296. #endif /* compiler */
  297. #if _MSC_VER >= 1200
  298. # define STLSOFT_CF_TYPENAME_TYPE_KEYWORD_SUPPORT
  299. #endif /* compiler */
  300. #if _MSC_VER >= 1300
  301. # define STLSOFT_CF_TYPENAME_TYPE_DEF_KEYWORD_SUPPORT
  302. #endif /* compiler */
  303. /*
  304. # define STLSOFT_CF_TYPENAME_TYPE_MIL_KEYWORD_SUPPORT
  305. */
  306. #if _MSC_VER >= 1300
  307. # define STLSOFT_CF_TYPENAME_TYPE_RET_KEYWORD_SUPPORT
  308. #endif /* compiler */
  309. #if _MSC_VER >= 1310
  310. # define STLSOFT_CF_ADL_SUPPORT
  311. #endif /* compiler */
  312. #if _MSC_VER >= 1300
  313. # define STLSOFT_CF_STATIC_ARRAY_SIZE_DETERMINATION_SUPPORT
  314. #endif /* compiler */
  315. #if defined(_MSC_EXTENSIONS) && \
  316. _MSC_VER < 1310
  317. # define STLSOFT_CF_MOVE_CONSTRUCTOR_SUPPORT
  318. #endif /* _MSC_EXTENSIONS && _MSC_VER < 1310 */
  319. #if _MSC_VER >= 1300
  320. # define STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT
  321. # define STLSOFT_CF_OPERATOR_NOT_VIA_OPERATOR_POINTER_TO_MEMBER_SUPPORT
  322. #endif /* compiler */
  323. #if _MSC_VER <= 1200
  324. # define STLSOFT_CF_REQUIRE_RETURN_ALWAYS
  325. #endif /* compiler */
  326. /* /////////////////////////////////////////////////////////////////////////
  327. * Support for C++ language features - 2
  328. *
  329. * - templates
  330. * - specialisation syntax (template <>)
  331. * - partial specialisation
  332. * - function template
  333. * - class template
  334. * - member class template
  335. * - member function template
  336. * - member range function template
  337. * - constructor template
  338. * - template template
  339. * - class template fundamental argument
  340. * - class template type argument
  341. * - class template member function argument
  342. * - class template default fundamental argument
  343. * - class template default type argument
  344. * - function template parameter list requires template parameter
  345. * - member function template overload is properly discriminated against
  346. * other non-template member function
  347. * - constructor template overload is properly discriminated against
  348. * other non-template constructor
  349. * - copy-constructor template overload is properly discriminated against
  350. * other non-template copy-constructor
  351. */
  352. #if _MSC_VER >= 1100
  353. # define STLSOFT_CF_TEMPLATE_SUPPORT
  354. #endif /* compiler */
  355. #if _MSC_VER >= 1100
  356. # define STLSOFT_CF_TEMPLATE_SPECIALISATION_SYNTAX_SUPPORT
  357. #endif /* compiler */
  358. #if _MSC_VER >= 1310
  359. # define STLSOFT_CF_TEMPLATE_PARTIAL_SPECIALISATION_SUPPORT
  360. #endif /* compiler */
  361. #if _MSC_VER >= 1100
  362. # define STLSOFT_CF_TEMPLATE_FUNCTION_TEMPLATE_SUPPORT
  363. #endif /* compiler */
  364. #if _MSC_VER >= 1100
  365. # define STLSOFT_CF_TEMPLATE_CLASS_TEMPLATE_SUPPORT
  366. #endif /* compiler */
  367. #if _MSC_VER >= 1100
  368. # define STLSOFT_CF_TEMPLATE_MEMBER_CLASS_TEMPLATE_SUPPORT
  369. #endif /* compiler */
  370. #if _MSC_VER >= 1100
  371. # define STLSOFT_CF_TEMPLATE_MEMBER_FUNCTION_TEMPLATE_SUPPORT
  372. #endif /* compiler */
  373. #if _MSC_VER >= 1200
  374. # define STLSOFT_CF_TEMPLATE_MEMBER_RANGE_FUNCTION_TEMPLATE_SUPPORT
  375. #endif /* compiler */
  376. /* Although VC++ 5.0 does work with this in isolated cases, in practice it experiences
  377. * too many internal compiler errors, or compiler lock-ups, to make it tolerable
  378. */
  379. #if _MSC_VER > 1100
  380. # define STLSOFT_CF_TEMPLATE_CTOR_TEMPLATE_SUPPORT
  381. #endif /* compiler */
  382. #if _MSC_VER >= 1300
  383. # define STLSOFT_CF_TEMPLATE_TEMPLATE_SUPPORT
  384. #endif /* compiler */
  385. #if _MSC_VER >= 1100
  386. # define STLSOFT_CF_TEMPLATE_FUNDAMENTAL_PARAMETER_SUPPORT
  387. #endif /* compiler */
  388. #if _MSC_VER >= 1100
  389. # define STLSOFT_CF_TEMPLATE_TYPE_PARAMETER_SUPPORT
  390. #endif /* compiler */
  391. #if _MSC_VER >= 1310
  392. # define STLSOFT_CF_TEMPLATE_MEMBER_FUNCTION_PARAMETER_SUPPORT
  393. #endif /* compiler */
  394. #if _MSC_VER >= 1100
  395. # define STLSOFT_CF_TEMPLATE_DEFAULT_FUNDAMENTAL_PARAMETER_SUPPORT
  396. #endif /* compiler */
  397. /* Although VC++ 5.0 does work with this in isolated cases, in practice it experiences
  398. * too many internal compiler errors, or compiler lock-ups, to make it tolerable
  399. */
  400. #if _MSC_VER >= 1100
  401. # define STLSOFT_CF_TEMPLATE_DEFAULT_TYPE_PARAMETER_SUPPORT
  402. #endif /* compiler */
  403. #if _MSC_VER < 1100
  404. # define STLSOFT_CF_TEMPLATE_FUNCTION_TEMPLATE_REQUIRES_TEMPLATE_PARAMETERS_IN_FUNCTION_PARAMETER_LIST
  405. #endif /* compiler */
  406. #if _MSC_VER >= 1300
  407. # define STLSOFT_CF_TEMPLATE_MEMBER_FUNCTION_TEMPLATE_OVERLOAD_DISCRIMINATED_AGAINST_NON_TEMPLATE_MEMBER_FUNCTION
  408. #endif /* compiler */
  409. #if _MSC_VER >= 1310
  410. # define STLSOFT_CF_TEMPLATE_CONSTRUCTOR_TEMPLATE_OVERLOAD_DISCRIMINATED_AGAINST_NON_TEMPLATE_CONSTRUCTOR
  411. #endif /* compiler */
  412. /* This caters for the case where a copy constructor and a template copy constructor -
  413. * as in the case of an allocator class template - may not overload.
  414. */
  415. #if _MSC_VER >= 1300
  416. # define STLSOFT_CF_TEMPLATE_COPY_CONSTRUCTOR_TEMPLATE_OVERLOAD_DISCRIMINATED_AGAINST_NON_TEMPLATE_COPY_CONSTRUCTOR
  417. #endif /* compiler */
  418. /* /////////////////////////////////////////////////////////////////////////
  419. * Inline assembler
  420. */
  421. #if defined(_M_IX86)
  422. # define STSLSOFT_INLINE_ASM_SUPPORTED
  423. # define STSLSOFT_ASM_IN_INLINE_SUPPORTED
  424. #elif defined(_M_IA64) || \
  425. defined(_M_X64)
  426. /* VC++ 64-bit compilers do not support inline assembler for. */
  427. #endif /* arch */
  428. /* /////////////////////////////////////////////////////////////////////////
  429. * Calling convention
  430. *
  431. * On x86, the following are supported:
  432. * - cdecl
  433. * - fastcall
  434. * - stdcall
  435. *
  436. * On IA64/x64 there is only a single calling convention. Calling convention
  437. * keywords are ignored.
  438. */
  439. #define STLSOFT_CF_THISCALL_SUPPORTED
  440. #if defined(_M_IX86)
  441. # define STLSOFT_CF_CDECL_SUPPORTED
  442. # ifndef _MANAGED
  443. # define STLSOFT_CF_FASTCALL_SUPPORTED
  444. # endif /* !_MANAGED */
  445. # define STLSOFT_CF_STDCALL_SUPPORTED
  446. # define STLSOFT_CDECL __cdecl
  447. # ifndef _MANAGED
  448. # define STLSOFT_FASTCALL __fastcall
  449. # endif /* !_MANAGED */
  450. # define STLSOFT_STDCALL __stdcall
  451. #elif defined(_M_IA64) || \
  452. defined(_M_X64)
  453. # define STLSOFT_CF_CDECL_SUPPORTED
  454. # define STLSOFT_CDECL
  455. #else /* ? arch */
  456. # error Only defined for the Intel x86, IA64 and x64 architectures
  457. #endif /* arch */
  458. /* /////////////////////////////////////////////////////////////////////////
  459. * Integer sizes
  460. */
  461. #define _STLSOFT_SIZEOF_CHAR (1)
  462. #define _STLSOFT_SIZEOF_SHORT (2)
  463. #define _STLSOFT_SIZEOF_INT (4)
  464. #define _STLSOFT_SIZEOF_LONG (4)
  465. #if _MSC_VER >= 1400
  466. # define _STLSOFT_SIZEOF_LONG_LONG (8)
  467. #endif /* compiler */
  468. /* /////////////////////////////////////////////////////////////////////////
  469. * Size-specific integer types
  470. *
  471. * The purpose of this section is to define the following types:
  472. *
  473. * - 8-bit signed and unsigned integers
  474. * - 16-bit signed and unsigned integers
  475. * - 32-bit signed and unsigned integers
  476. * - (optionally) 64-bit signed and unsigned integers
  477. *
  478. * and to define, where appropriate the following symbols (used for
  479. * overloading):
  480. *
  481. * - STLSOFT_CF_CHAR_DISTINCT_INT_TYPE
  482. * - STLSOFT_CF_SHORT_DISTINCT_INT_TYPE
  483. * - STLSOFT_CF_INT_DISTINCT_INT_TYPE
  484. * - STLSOFT_CF_LONG_DISTINCT_INT_TYPE
  485. * - STLSOFT_CF_LONG_LONG_DISTINCT_INT_TYPE
  486. *
  487. * which indicate that a given type is not used in the size-specific types.
  488. */
  489. /* 8-bit integer */
  490. #define STLSOFT_CF_8BIT_INT_SUPPORT
  491. #if _MSC_VER >= 1020
  492. # define STLSOFT_SI08_T_BASE_TYPE signed __int8
  493. # define STLSOFT_UI08_T_BASE_TYPE unsigned __int8
  494. # if _MSC_VER == 1200
  495. # define STLSOFT_CF_CHAR_DISTINCT_INT_TYPE
  496. # endif /* compiler */
  497. #else /* ? compiler */
  498. # define STLSOFT_SI08_T_BASE_TYPE signed char
  499. # define STLSOFT_UI08_T_BASE_TYPE unsigned char
  500. #endif /* compiler */
  501. /* 16-bit integer */
  502. #define STLSOFT_CF_16BIT_INT_SUPPORT
  503. #if _MSC_VER >= 1020
  504. # define STLSOFT_SI16_T_BASE_TYPE signed __int16
  505. # define STLSOFT_UI16_T_BASE_TYPE unsigned __int16
  506. # if _MSC_VER == 1200
  507. # define STLSOFT_CF_SHORT_DISTINCT_INT_TYPE
  508. # endif /* compiler */
  509. #else /* ? compiler */
  510. # define STLSOFT_SI16_T_BASE_TYPE signed short
  511. # define STLSOFT_UI16_T_BASE_TYPE unsigned short
  512. #endif /* compiler */
  513. /* 32-bit integer */
  514. #define STLSOFT_CF_32BIT_INT_SUPPORT
  515. #if _MSC_VER >= 1020
  516. # define STLSOFT_SI32_T_BASE_TYPE signed __int32
  517. # define STLSOFT_UI32_T_BASE_TYPE unsigned __int32
  518. # if _MSC_VER == 1200
  519. # define STLSOFT_CF_INT_DISTINCT_INT_TYPE
  520. # endif /* compiler */
  521. # define STLSOFT_CF_LONG_DISTINCT_INT_TYPE
  522. #else /* ? compiler */
  523. # define STLSOFT_SI32_T_BASE_TYPE signed long
  524. # define STLSOFT_UI32_T_BASE_TYPE unsigned long
  525. # define STLSOFT_CF_INT_DISTINCT_INT_TYPE
  526. #endif /* compiler */
  527. /* 64-bit integer */
  528. #if _MSC_VER >= 1020
  529. # define STLSOFT_CF_64BIT_INT_SUPPORT
  530. # define STLSOFT_CF_64BIT_INT_IS___int64
  531. # define STLSOFT_SI64_T_BASE_TYPE signed __int64
  532. # define STLSOFT_UI64_T_BASE_TYPE unsigned __int64
  533. #endif /* compiler */
  534. /* /////////////////////////////////////////////////////////////////////////
  535. * Still to-be-determined features
  536. */
  537. /* wchar_t */
  538. #if _MSC_VER >= 1300
  539. /* Even though VC 7.0 and 7.1 provide a native wchar_t type, that is __wchar_t,
  540. * it is not compatible with their libraries (which use the typedef wchar_t),
  541. * so we cannot use it.
  542. *
  543. * wchar_t itself may be used, when _NATIVE_WCHAR_T_DEFINED is defined
  544. */
  545. # ifdef _NATIVE_WCHAR_T_DEFINED
  546. # define STLSOFT_CF_NATIVE_WCHAR_T_SUPPORT
  547. /* # define STLSOFT_NATIVE_WCHAR_T __wchar_t */
  548. # elif defined(_WCHAR_T_DEFINED)
  549. # define STLSOFT_CF_TYPEDEF_WCHAR_T_SUPPORT
  550. # else
  551. /* Not defined */
  552. # define STLSOFT_CF_TYPEDEF_WCHAR_T_SUPPORT
  553. # endif /* _WCHAR_T_DEFINED */
  554. #else
  555. /* Previous versions do not have a native type, but do have the typedef wchar_t
  556. * when _WCHAR_T_DEFINED is defined
  557. */
  558. # if defined(_WCHAR_T_DEFINED)
  559. # define STLSOFT_CF_TYPEDEF_WCHAR_T_SUPPORT
  560. # endif /* _WCHAR_T_DEFINED */
  561. #endif /* compiler */
  562. /* */
  563. #if ( _MSC_VER >= 1100 && \
  564. _MSC_VER < 1310) || \
  565. _MSC_VER >= 1500
  566. # define STLSOFT_CF_FUNCTION_SIGNATURE_FULL_ARG_QUALIFICATION_REQUIRED
  567. #endif /* compiler */
  568. #if _MSC_VER >= 1100
  569. # define STLSOFT_CF_TEMPLATE_OUTOFCLASSFN_QUALIFIED_TYPE_SUPPORT
  570. #else
  571. /* Not supported */
  572. # ifdef STLSOFT_CF_TEMPLATE_OUTOFCLASSFN_QUALIFIED_TYPE_SUPPORT
  573. # undef STLSOFT_CF_TEMPLATE_OUTOFCLASSFN_QUALIFIED_TYPE_SUPPORT
  574. # endif /* STLSOFT_CF_TEMPLATE_OUTOFCLASSFN_QUALIFIED_TYPE_SUPPORT */
  575. #endif /* compiler */
  576. #if _MSC_VER >= 1100
  577. # define STLSOFT_CF_std_NAMESPACE
  578. #endif /* compiler */
  579. #define STLSOFT_CF_std_char_traits_AVAILABLE
  580. #if _MSC_VER >= 1100
  581. # define STLSOFT_CF_PARENT_TYPES_CAN_BE_USED_IN_NON_TEMPLATE
  582. # define STLSOFT_CF_PARENT_TYPES_CAN_BE_USED_IN_TEMPLATE
  583. #endif /* compiler */
  584. #define STLSOFT_CF_VENEER_SUPPORT
  585. #if !defined(_ATL_MIN_CRT)
  586. # define STLSOFT_CF_ALLOCATOR_BASE_EXPENSIVE
  587. #endif /* !_ATL_MIN_CRT */
  588. /*
  589. # define STLSOFT_CF_COMPILER_WARNS_NO_PUBLIC_DTOR
  590. */
  591. #if _MSC_VER < 1100
  592. # define STLSOFT_CF_TEMPLATE_SHIMS_NOT_SUPPORTED
  593. #endif /* compiler */
  594. /* /////////////////////////////////////////////////////////////////////////
  595. * Quality assurance features
  596. */
  597. #if defined(_STLSOFT_CUSTOM_ASSERT)
  598. /* You have defined the preprocessor symbol _STLSOFT_CUSTOM_ASSERT,
  599. * which stipulates that you will be providing your own assert. This
  600. * requires that you have defined _STLSOFT_CUSTOM_ASSERT() as a macro
  601. * taking 1 parameter (the condition to assert).
  602. *
  603. * Suppose you have a function DisplayAssert_(), which has the
  604. * following signature:
  605. *
  606. * void DisplayAssert_(char const* file, int line, char const* expression);
  607. *
  608. * Presumably you would also have your own assert macro, say MY_ASSERT(),
  609. * defined as:
  610. *
  611. * #define MY_ASSERT(_x) ((void)((!(_x)) ? ((void)(DisplayAssert_(__FILE__, __LINE__, #_x))) : ((void)0)))
  612. *
  613. * so you would simply need to define _STLSOFT_CUSTOM_ASSERT() in terms of
  614. * MY_ASSERT(), as in:
  615. *
  616. * #define _STLSOFT_CUSTOM_ASSERT(_x) MY_ASSERT(_x)
  617. *
  618. * where
  619. */
  620. # define __STLSOFT_CF_ASSERT_SUPPORT
  621. # define STLSOFT_CF_ASSERT_SUPPORT
  622. # define STLSOFT_ASSERT(_x) _STLSOFT_CUSTOM_ASSERT(_x)
  623. # if defined(_STLSOFT_CUSTOM_ASSERT_INCLUDE)
  624. # define __STLSOFT_CF_ASSERT_INCLUDE_NAME _STLSOFT_CUSTOM_ASSERT_INCLUDE
  625. # else /* ? _STLSOFT_CUSTOM_ASSERT_INCLUDE */
  626. # error You must define _STLSOFT_CUSTOM_ASSERT_INCLUDE along with _STLSOFT_CUSTOM_ASSERT()
  627. # endif /* !_STLSOFT_CUSTOM_ASSERT_INCLUDE */
  628. #else /* ? _STLSOFT_CUSTOM_ASSERT */
  629. # define __STLSOFT_CF_ASSERT_SUPPORT
  630. # define STLSOFT_CF_ASSERT_SUPPORT
  631. /* #define __STLSOFT_CF_USE_cassert */
  632. # define __STLSOFT_CF_ASSERT_INCLUDE_NAME <crtdbg.h>
  633. # define STLSOFT_ASSERT(_x) _ASSERTE(_x)
  634. #endif /* _STLSOFT_CUSTOM_ASSERT */
  635. /* /////////////////////////////////////////////////////////////////////////
  636. * Compiler warning suppression
  637. */
  638. /* Suppresses: "'identifier' : has bad storage class" */
  639. #pragma warning(disable : 4042)
  640. /* Suppresses: "typedef-name 'identifier1' used as synonym for class-name 'identifier2'" */
  641. #pragma warning(disable : 4097)
  642. /* Suppresses: "conditional expression is constant" */
  643. #pragma warning(disable : 4127)
  644. /* Suppresses: "qualifier applied to reference type ignored" */
  645. #pragma warning(disable : 4181)
  646. /* Suppresses: "'<function>' has C-linkage specified, but returns UDT '<udt>' which is incompatible with C" */
  647. #if _MSC_VER < 1200
  648. # pragma warning(disable : 4190)
  649. #endif /* compiler */
  650. /* Suppresses: "nonstandard extension used : nameless struct/union" */
  651. #pragma warning(disable : 4201)
  652. /* Suppresses: "nonstandard extension used : 'xxxx' keyword is reserved for future use" */
  653. #if _MSC_VER < 1100
  654. # pragma warning(disable : 4237)
  655. #endif /* compiler */
  656. /* Suppresses: "return type for 'identifier::operator ->' is not a UDT or reference to a UDT. Will produce errors if applied using infix notation" */
  657. #if _MSC_VER < 1300
  658. # pragma warning(disable : 4284)
  659. #endif /* compiler */
  660. /* Suppresses: "C++ Exception Specification ignored" */
  661. #pragma warning(disable : 4290)
  662. #if defined(_MSC_EXTENSIONS)
  663. /* Suppresses: nonstandard extension used : 'argument' : conversion from 'X' to 'X&' */
  664. # pragma warning(disable : 4239)
  665. #endif /* _MSC_EXTENSIONS && _MSC_VER < 1310 */
  666. /* Suppresses: "'' decorated name length exceeded, name was truncated" */
  667. #pragma warning(disable : 4503)
  668. #if _MSC_VER < 1300 && \
  669. !defined(STLSOFT_STRICT)
  670. # pragma warning(disable : 4512)
  671. #endif /* _MSC_VER < 1300 && STLSOFT_STRICT */
  672. /* Suppresses: "unreferenced inline function has been removed" */
  673. #pragma warning(disable : 4514)
  674. #if _MSC_VER >= 1310
  675. /* Suppresses: "expression before comma has no effect; expected expression with side-effect" */
  676. # pragma warning(disable : 4548)
  677. /* Suppresses: "#pragma warning : there is no warning number 'XXXX'" */
  678. # pragma warning(disable: 4619)
  679. #endif /* compiler */
  680. /* Suppresses: "C++ language change: to explicitly specialize class template 'X' use the following syntax: template<> struct X<Y>" */
  681. #if _MSC_VER < 1310
  682. # pragma warning(disable : 4663)
  683. #endif /* compiler */
  684. /* Suppresses: "'function' : resolved overload was found by argument-dependent lookup" */
  685. #if _MSC_VER >= 1310
  686. # pragma warning(disable : 4675)
  687. #endif /* compiler */
  688. /* Suppresses: "function not expanded" */
  689. #pragma warning(disable : 4710)
  690. /* Suppresses: "identifier was truncated to '255' characters in the browser information" */
  691. #pragma warning(disable : 4786)
  692. #if _MSC_VER >= 1310
  693. /* Suppresses: "'bytes' bytes padding added after member 'member'" */
  694. # pragma warning(disable : 4820)
  695. #endif /* compiler */
  696. #if _MSC_VER < 1300
  697. # ifdef __cplusplus
  698. # include <functional> /* This is included so we get past the MSVC promotion of 4663 before we then disable it again */
  699. # endif /* __cplusplus */
  700. # pragma warning(disable : 4663)
  701. # ifdef __cplusplus
  702. # include <utility> /* This is included so we get past the MSVC promotion of 4284 before we then disable it again */
  703. # endif /* __cplusplus */
  704. # pragma warning(disable : 4284)
  705. #endif /* compiler */
  706. #if _MSC_VER < 1300 && \
  707. defined(__cplusplus) && \
  708. defined(_DEBUG)
  709. # include <cstddef>
  710. # ifdef _XSTDDEF_
  711. # undef _TRY_BEGIN
  712. # define _TRY_BEGIN if(1) {
  713. # undef _CATCH
  714. # define _CATCH(x) } else {
  715. # undef _CATCH_ALL
  716. # define _CATCH_ALL } else {
  717. # undef _CATCH_END
  718. # define _CATCH_END }
  719. # endif /* _XSTDDEF_ */
  720. #endif /* compiler */
  721. /* /////////////////////////////////////////////////////////////////////////
  722. * Obsolete features
  723. */
  724. #include <stlsoft/internal/cccap/obsolete.h>
  725. /* ///////////////////////////// end of file //////////////////////////// */