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.

604 lines
19 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: stlsoft/internal/cccap/gcc.h
  3. *
  4. * Purpose: Compiler feature discrimination for GNU C/C++.
  5. *
  6. * Created: 7th February 2003
  7. * Updated: 14th March 2012
  8. *
  9. * Thanks: To Sergey Nikulov, for PowerPC (BSD) compatibility fixes
  10. *
  11. * Home: http://stlsoft.org/
  12. *
  13. * Copyright (c) 2003-2012, Matthew Wilson and Synesis Software
  14. * All rights reserved.
  15. *
  16. * Redistribution and use in source and binary forms, with or without
  17. * modification, are permitted provided that the following conditions are met:
  18. *
  19. * - Redistributions of source code must retain the above copyright notice, this
  20. * list of conditions and the following disclaimer.
  21. * - Redistributions in binary form must reproduce the above copyright notice,
  22. * this list of conditions and the following disclaimer in the documentation
  23. * and/or other materials provided with the distribution.
  24. * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
  25. * any contributors may be used to endorse or promote products derived from
  26. * this software without specific prior written permission.
  27. *
  28. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  29. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  30. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  31. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  32. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  33. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  34. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  35. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  36. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  37. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  38. * POSSIBILITY OF SUCH DAMAGE.
  39. *
  40. * ////////////////////////////////////////////////////////////////////// */
  41. #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
  42. # error This file must not be included independently of stlsoft/stlsoft.h
  43. #endif /* !STLSOFT_INCL_STLSOFT_H_STLSOFT */
  44. /** \file stlsoft/internal/cccap/gcc.h
  45. *
  46. * Compiler feature discrimination for GNU C/C++
  47. * (\ref group__library__internal).
  48. */
  49. #ifdef STLSOFT_INCL_H_STLSOFT_CCCAP_GCC
  50. # error This file cannot be included more than once in any compilation unit
  51. #endif /* STLSOFT_INCL_H_STLSOFT_CCCAP_GCC */
  52. /* ////////////////////////////////////////////////////////////////////// */
  53. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  54. # define STLSOFT_VER_H_STLSOFT_CCCAP_GCC_MAJOR 3
  55. # define STLSOFT_VER_H_STLSOFT_CCCAP_GCC_MINOR 21
  56. # define STLSOFT_VER_H_STLSOFT_CCCAP_GCC_REVISION 1
  57. # define STLSOFT_VER_H_STLSOFT_CCCAP_GCC_EDIT 86
  58. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  59. /* /////////////////////////////////////////////////////////////////////////
  60. * Structure:
  61. *
  62. * - auto-generation and compatibility
  63. * - preprocessor features
  64. * - support for built-in types
  65. * - built-in type characteristics
  66. * - support for C/C++ language features
  67. * - support for C language features
  68. * - support for C++ language features - 1
  69. * - support for C++ language features - 2
  70. * - inline assembler
  71. * - calling convention
  72. * - integer sizes
  73. * - size-specific integer types
  74. * - still to-be-determined features
  75. * - assertions
  76. * - compiler warning suppression
  77. * - obsolete features
  78. */
  79. /* /////////////////////////////////////////////////////////////////////////
  80. * Auto-generation and compatibility
  81. */
  82. /*
  83. [<[STLSOFT-AUTO:NO-DOCFILELABEL]>]
  84. [<[STLSOFT-AUTO:NO-UNITTEST]>]
  85. */
  86. /* /////////////////////////////////////////////////////////////////////////
  87. * Custom macros
  88. */
  89. #ifdef __GNUC_PATCHLEVEL__
  90. # define STLSOFT_INTERNAL_GCC_PATCHLEVEL_ __GNUC_PATCHLEVEL__
  91. #else /* ? __GNUC_PATCHLEVEL__ */
  92. # define STLSOFT_INTERNAL_GCC_PATCHLEVEL_ (0)
  93. #endif /* __GNUC_PATCHLEVEL__ */
  94. #define STLSOFT_GCC_VER \
  95. ((__GNUC__ * 10000) \
  96. + \
  97. (__GNUC_MINOR__ * 100) \
  98. + \
  99. (STLSOFT_INTERNAL_GCC_PATCHLEVEL_ * 1))
  100. /* /////////////////////////////////////////////////////////////////////////
  101. * Preprocessor features
  102. *
  103. * - #pragma message
  104. * - #pragma once
  105. * - __COUNTER__
  106. * - __FUNCTION__
  107. * - variadic macros
  108. */
  109. /*
  110. #define STLSOFT_PPF_pragma_message_SUPPORT
  111. */
  112. #if __GNUC__ > 3 || \
  113. ( __GNUC__ == 3 && \
  114. __GNUC_MINOR__ >= 4)
  115. # define STLSOFT_PPF_pragma_once_SUPPORT
  116. #endif /* compiler */
  117. #if __GNUC__ > 4 || \
  118. ( __GNUC__ == 4 && \
  119. __GNUC_MINOR__ >= 3)
  120. # define STLSOFT_PPF_COUNTER_SYMBOL_SUPPORT
  121. #endif /* compiler */
  122. #if __GNUC__ >= 3
  123. # define STLSOFT_PPF_FUNCTION_SYMBOL_SUPPORT
  124. #endif /* compiler */
  125. #if __GNUC__ > 3 || \
  126. ( __GNUC__ == 3 && \
  127. __GNUC_MINOR__ >= 4)
  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 __cplusplus
  143. # define STLSOFT_CF_BUILTIN_bool_SUPPORT
  144. #endif /* __cplusplus */
  145. #if __GNUC__ > 3 || \
  146. ( __GNUC__ == 3 && \
  147. __GNUC_MINOR__ >= 2)
  148. # define STLSOFT_CF_BUILTIN_wchar_t_SUPPORT
  149. #endif /* 3.2+ */
  150. #define STLSOFT_CF_BUILTIN_long_long_SUPPORT
  151. #define STLSOFT_CF_BUILTIN___int8_SUPPORT
  152. #define STLSOFT_CF_BUILTIN___int16_SUPPORT
  153. #define STLSOFT_CF_BUILTIN___int32_SUPPORT
  154. #define STLSOFT_CF_BUILTIN___int64_SUPPORT
  155. /* /////////////////////////////////////////////////////////////////////////
  156. * Built-in type characteristics
  157. *
  158. * - char is unsigned
  159. * - wchar_t
  160. * - synthesised
  161. * - available
  162. */
  163. #ifdef __CHAR_UNSIGNED__
  164. # define STLSOFT_CF_char_IS_UNSIGNED
  165. #endif /* __CHAR_UNSIGNED__ */
  166. #ifdef STLSOFT_CF_BUILTIN_wchar_t_SUPPORT
  167. # define STLSOFT_CF_NATIVE_WCHAR_T_SUPPORT
  168. #endif /* STLSOFT_CF_BUILTIN_wchar_t_SUPPORT */
  169. /* /////////////////////////////////////////////////////////////////////////
  170. * Support for C/C++ language features
  171. *
  172. * - return void
  173. * - static assertions
  174. * - anonymous unions
  175. * - -ve % +ve => -ve result
  176. */
  177. #define STLSOFT_CF_return_void_SUPPORT
  178. #define STLSOFT_CF_STATIC_ASSERT_SUPPORT
  179. #define STLSOFT_CF_ANONYMOUS_UNION_SUPPORT
  180. #define STLSOFT_CF_NEGATIVE_MODULUS_POSITIVE_GIVES_NEGATIVE_RESULT
  181. /* /////////////////////////////////////////////////////////////////////////
  182. * Support for C language features
  183. *
  184. * - inline
  185. * - C99 inline keyword
  186. * - compiler-specific keyword
  187. */
  188. #if __GNUC__ >= 4
  189. # define STLSOFT_CF_C99_INLINE
  190. #else /* ? compiler */
  191. # define STLSOFT_CUSTOM_C_INLINE __inline__
  192. #endif /* compiler */
  193. /* /////////////////////////////////////////////////////////////////////////
  194. * Support for C++ language features - 1
  195. *
  196. * - exceptions
  197. * - exception signatures
  198. * - exception signatures expense
  199. * - operator new throws bad_alloc
  200. * - RTTI
  201. * - namespaces
  202. * - STLSoft namespace(s)?
  203. * - member constants
  204. * - explicit keyword
  205. * - mutable keyword
  206. * - template keyword
  207. * - typename keyword
  208. * - in a template parameter
  209. * - type disambiguation inside template bodies
  210. * - disambiguation in default template arguments
  211. * - type disambiguation inside initialiser lists in class template constructors
  212. * - type disambiguation the return types in templates
  213. * - argument-dependent lookup
  214. * - static array-size determination
  215. * - empty-derived optimisation
  216. * -
  217. * - empty-base optimisation
  218. * -
  219. * - move constructor support
  220. * - operators
  221. * - operator bool implemented as pointer-to-member
  222. * - operator ! implemented as pointer-to-member
  223. */
  224. #ifdef __cplusplus
  225. # ifdef __EXCEPTIONS
  226. # define STLSOFT_CF_EXCEPTION_SUPPORT
  227. # define STLSOFT_CF_EXCEPTION_SIGNATURE_SUPPORT
  228. # define STLSOFT_CF_THROW_BAD_ALLOC
  229. # endif /* __EXCEPTIONS */
  230. #endif /* __cplusplus */
  231. #ifdef __cplusplus
  232. # define STLSOFT_CF_RTTI_SUPPORT
  233. #endif /* __cplusplus */
  234. #ifdef __cplusplus
  235. # define STLSOFT_CF_NAMESPACE_SUPPORT
  236. #endif /* __cplusplus */
  237. /* #define _STLSOFT_NO_NAMESPACES */
  238. #define STLSOFT_CF_MEMBER_CONSTANT_SUPPORT
  239. #define STLSOFT_CF_EXPLICIT_KEYWORD_SUPPORT
  240. #define STLSOFT_CF_MUTABLE_KEYWORD_SUPPORT
  241. #if __GNUC__ > 3 || \
  242. ( __GNUC__ == 3 && \
  243. __GNUC_MINOR__ >= 4)
  244. # define STLSOFT_CF_TEMPLATE_QUALIFIER_KEYWORD_SUPPORT
  245. #endif /* compiler */
  246. #define STLSOFT_CF_TYPENAME_PARAM_KEYWORD_SUPPORT
  247. #define STLSOFT_CF_TYPENAME_TYPE_KEYWORD_SUPPORT
  248. #define STLSOFT_CF_TYPENAME_TYPE_DEF_KEYWORD_SUPPORT
  249. /* #define STLSOFT_CF_TYPENAME_TYPE_MIL_KEYWORD_SUPPORT */
  250. #define STLSOFT_CF_TYPENAME_TYPE_RET_KEYWORD_SUPPORT
  251. #define STLSOFT_CF_ADL_SUPPORT
  252. #if __GNUC__ >= 3
  253. # define STLSOFT_CF_STATIC_ARRAY_SIZE_DETERMINATION_SUPPORT
  254. #endif /* compiler */
  255. /* #define STLSOFT_CF_MOVE_CONSTRUCTOR_SUPPORT */
  256. #define STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT
  257. #define STLSOFT_CF_OPERATOR_NOT_VIA_OPERATOR_POINTER_TO_MEMBER_SUPPORT
  258. /* /////////////////////////////////////////////////////////////////////////
  259. * Support for C++ language features - 2
  260. *
  261. * - templates
  262. * - specialisation syntax (template <>)
  263. * - partial specialisation
  264. * - function template
  265. * - class template
  266. * - member class template
  267. * - member function template
  268. * - member range function template
  269. * - constructor template
  270. * - template template
  271. * - class template fundamental argument
  272. * - class template type argument
  273. * - class template member function argument
  274. * - class template default fundamental argument
  275. * - class template default type argument
  276. * - function template parameter list requires template parameter
  277. * - member function template overload is properly discriminated against
  278. * other non-template member function
  279. * - constructor template overload is properly discriminated against
  280. * other non-template constructor
  281. * - copy-constructor template overload is properly discriminated against
  282. * other non-template copy-constructor
  283. */
  284. #define STLSOFT_CF_TEMPLATE_SUPPORT
  285. #define STLSOFT_CF_TEMPLATE_SPECIALISATION_SYNTAX_SUPPORT
  286. #define STLSOFT_CF_TEMPLATE_PARTIAL_SPECIALISATION_SUPPORT
  287. #define STLSOFT_CF_TEMPLATE_FUNCTION_TEMPLATE_SUPPORT
  288. #define STLSOFT_CF_TEMPLATE_CLASS_TEMPLATE_SUPPORT
  289. #define STLSOFT_CF_TEMPLATE_MEMBER_CLASS_TEMPLATE_SUPPORT
  290. #define STLSOFT_CF_TEMPLATE_MEMBER_FUNCTION_TEMPLATE_SUPPORT
  291. #if __GNUC__ >= 3
  292. # define STLSOFT_CF_TEMPLATE_MEMBER_RANGE_FUNCTION_TEMPLATE_SUPPORT
  293. #endif /* compiler */
  294. #define STLSOFT_CF_TEMPLATE_CTOR_TEMPLATE_SUPPORT
  295. #define STLSOFT_CF_TEMPLATE_TEMPLATE_SUPPORT
  296. #define STLSOFT_CF_TEMPLATE_FUNDAMENTAL_PARAMETER_SUPPORT
  297. #define STLSOFT_CF_TEMPLATE_TYPE_PARAMETER_SUPPORT
  298. /* #define STLSOFT_CF_TEMPLATE_MEMBER_FUNCTION_PARAMETER_SUPPORT */
  299. #define STLSOFT_CF_TEMPLATE_DEFAULT_FUNDAMENTAL_PARAMETER_SUPPORT
  300. #define STLSOFT_CF_TEMPLATE_DEFAULT_TYPE_PARAMETER_SUPPORT
  301. /* #define STLSOFT_CF_TEMPLATE_FUNCTION_TEMPLATE_REQUIRES_TEMPLATE_PARAMETERS_IN_FUNCTION_PARAMETER_LIST */
  302. #define STLSOFT_CF_TEMPLATE_MEMBER_FUNCTION_TEMPLATE_OVERLOAD_DISCRIMINATED_AGAINST_NON_TEMPLATE_MEMBER_FUNCTION
  303. #if __GNUC__ >= 3
  304. # define STLSOFT_CF_TEMPLATE_CONSTRUCTOR_TEMPLATE_OVERLOAD_DISCRIMINATED_AGAINST_NON_TEMPLATE_CONSTRUCTOR
  305. #endif /* compiler */
  306. /* #define STLSOFT_CF_TEMPLATE_COPY_CONSTRUCTOR_TEMPLATE_OVERLOAD_DISCRIMINATED_AGAINST_NON_TEMPLATE_COPY_CONSTRUCTOR */
  307. /* /////////////////////////////////////////////////////////////////////////
  308. * Inline assembler
  309. */
  310. /* #define STSLSOFT_INLINE_ASM_SUPPORTED */
  311. /* #define STSLSOFT_ASM_IN_INLINE_SUPPORTED */
  312. /* /////////////////////////////////////////////////////////////////////////
  313. * Calling convention
  314. */
  315. #define STLSOFT_CF_CDECL_SUPPORTED
  316. #if defined(WIN32)
  317. # define STLSOFT_CF_THISCALL_SUPPORTED
  318. # ifdef STLSOFT_CF_CDECL_SUPPORTED
  319. # define STLSOFT_CDECL __cdecl
  320. # endif /* STLSOFT_CF_CDECL_SUPPORTED */
  321. # if __GNUC__ > 2
  322. # define STLSOFT_CF_FASTCALL_SUPPORTED
  323. # define STLSOFT_FASTCALL __fastcall
  324. # endif /* __GNUC__ > 2 */
  325. # define STLSOFT_CF_STDCALL_SUPPORTED
  326. # define STLSOFT_STDCALL __stdcall
  327. # if ( __GNUC__ < 3 || \
  328. ( __GNUC__ == 3 && \
  329. __GNUC_MINOR__ < 4))
  330. # define STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  331. # endif /* version */
  332. #else /* ? OS */
  333. # ifdef STLSOFT_CF_CDECL_SUPPORTED
  334. # define STLSOFT_CDECL
  335. # endif /* STLSOFT_CF_CDECL_SUPPORTED */
  336. #endif /* !unix && !__unix__ */
  337. /* /////////////////////////////////////////////////////////////////////////
  338. * Integer sizes
  339. */
  340. #define _STLSOFT_SIZEOF_CHAR (1)
  341. #if defined(__ILP64__) || \
  342. defined(_ILP64)
  343. # error Currently the STLSoft libraries are not compatible with the ILP64 memory model
  344. #elif defined(__LP64__) || \
  345. defined(_LP64)
  346. /* LP64 */
  347. # define _STLSOFT_SIZEOF_SHORT (2)
  348. # define _STLSOFT_SIZEOF_INT (4)
  349. # define _STLSOFT_SIZEOF_LONG (8)
  350. # define _STLSOFT_SIZEOF_LONG_LONG (8)
  351. #elif defined(__LLP64__) || \
  352. defined(_WIN32) || \
  353. defined(_WIN64) || \
  354. defined(__i386__) || \
  355. defined(__i386) || \
  356. defined(__POWERPC__) || \
  357. defined(__ppc) || \
  358. defined(__ppc__) || \
  359. defined(_ARCH_PPC) || \
  360. defined(__PPC__) || \
  361. defined(__powerpc__)
  362. /* LLP64 */
  363. # define _STLSOFT_SIZEOF_SHORT (2)
  364. # define _STLSOFT_SIZEOF_INT (4)
  365. # define _STLSOFT_SIZEOF_LONG (4)
  366. # define _STLSOFT_SIZEOF_LONG_LONG (8)
  367. #else /* ? data model */
  368. # error Use of GCC has not been verified with any memory model other than LP64 and LLP64. Please contact Synesis Software
  369. #endif /* data model */
  370. /* /////////////////////////////////////////////////////////////////////////
  371. * Integral types
  372. *
  373. * The purpose of this section is to define the following types:
  374. *
  375. * - 8-bit signed and unsigned integers
  376. * - 16-bit signed and unsigned integers
  377. * - 32-bit signed and unsigned integers
  378. * - (optionally) 64-bit signed and unsigned integers
  379. *
  380. * and to define, where appropriate the following symbols (used for
  381. * overloading):
  382. *
  383. * - STLSOFT_CF_CHAR_DISTINCT_INT_TYPE
  384. * - STLSOFT_CF_SHORT_DISTINCT_INT_TYPE
  385. * - STLSOFT_CF_INT_DISTINCT_INT_TYPE
  386. * - STLSOFT_CF_LONG_DISTINCT_INT_TYPE
  387. * - STLSOFT_CF_LONG_LONG_DISTINCT_INT_TYPE
  388. *
  389. * which indicate that a given type is not used in the size-specific types.
  390. */
  391. /* 8-bit integer */
  392. #define STLSOFT_CF_8BIT_INT_SUPPORT
  393. #define STLSOFT_SI08_T_BASE_TYPE signed char
  394. #define STLSOFT_UI08_T_BASE_TYPE unsigned char
  395. /* 16-bit integer */
  396. #define STLSOFT_CF_16BIT_INT_SUPPORT
  397. #define STLSOFT_SI16_T_BASE_TYPE signed short
  398. #define STLSOFT_UI16_T_BASE_TYPE unsigned short
  399. /* 32-bit integer */
  400. #define STLSOFT_CF_32BIT_INT_SUPPORT
  401. #define STLSOFT_SI32_T_BASE_TYPE signed int
  402. #define STLSOFT_UI32_T_BASE_TYPE unsigned int
  403. #define STLSOFT_CF_LONG_DISTINCT_INT_TYPE
  404. /* 64-bit integer */
  405. #define STLSOFT_CF_64BIT_INT_SUPPORT
  406. #define STLSOFT_CF_64BIT_INT_IS_long_long
  407. #define STLSOFT_SI64_T_BASE_TYPE signed long long
  408. #define STLSOFT_UI64_T_BASE_TYPE unsigned long long
  409. /* ////////////////////////////////////////////////////////////////////// */
  410. /* ////////////////////////////////////////////////////////////////////// */
  411. /* ////////////////////////////////////////////////////////////////////// */
  412. /* ////////////////////////////////////////////////////////////////////// */
  413. /* ////////////////////////////////////////////////////////////////////// */
  414. /* ////////////////////////////////////////////////////////////////////// */
  415. /* ////////////////////////////////////////////////////////////////////// */
  416. /* ////////////////////////////////////////////////////////////////////// */
  417. /* ////////////////////////////////////////////////////////////////////// */
  418. /* ////////////////////////////////////////////////////////////////////// */
  419. /* /////////////////////////////////////////////////////////////////////////
  420. * Still to-be-determined features
  421. */
  422. #define STLSOFT_CF_FUNCTION_SIGNATURE_FULL_ARG_QUALIFICATION_REQUIRED
  423. /* Template support */
  424. /* #define STLSOFT_CF_EXCEPTION_SPEC_EXPENSIVE */
  425. #define STLSOFT_CF_TEMPLATE_OUTOFCLASSFN_QUALIFIED_TYPE_SUPPORT
  426. #define STLSOFT_CF_std_NAMESPACE
  427. #if __GNUC__ >= 3
  428. # define STLSOFT_CF_std_char_traits_AVAILABLE
  429. #endif /* compiler */
  430. #define STLSOFT_CF_PARENT_TYPES_CAN_BE_USED_IN_NON_TEMPLATE
  431. #define STLSOFT_CF_PARENT_TYPES_CAN_BE_USED_IN_TEMPLATE
  432. #if __GNUC__ >= 3
  433. # define STLSOFT_CF_VENEER_SUPPORT
  434. #endif /* compiler */
  435. #define STLSOFT_CF_ALLOCATOR_BASE_EXPENSIVE
  436. #define STLSOFT_CF_COMPILER_WARNS_NO_PUBLIC_DTOR
  437. /* Shims are supported?
  438. */
  439. /* #define STLSOFT_CF_TEMPLATE_SHIMS_NOT_SUPPORTED */
  440. /* /////////////////////////////////////////////////////////////////////////
  441. * Quality assurance features
  442. */
  443. #if defined(_STLSOFT_CUSTOM_ASSERT)
  444. /* You have defined the preprocessor symbol _STLSOFT_CUSTOM_ASSERT,
  445. * which stipulates that you will be providing your own assert. This
  446. * requires that you have defined _STLSOFT_CUSTOM_ASSERT() as a macro
  447. * taking 1 parameter (the condition to assert).
  448. *
  449. * Suppose you have a function DisplayAssert_(), which has the
  450. * following signature:
  451. *
  452. * void DisplayAssert_(char const* file, int line, char const* expression);
  453. *
  454. * Presumably you would also have your own assert macro, say MY_ASSERT(),
  455. * defined as:
  456. *
  457. * #define MY_ASSERT(_x) ((void)((!(_x)) ? ((void)(DisplayAssert_(__FILE__, __LINE__, #_x))) : ((void)0)))
  458. *
  459. * so you would simply need to define _STLSOFT_CUSTOM_ASSERT() in terms of
  460. * MY_ASSERT(), as in:
  461. *
  462. * #define _STLSOFT_CUSTOM_ASSERT(_x) MY_ASSERT(_x)
  463. *
  464. * where
  465. */
  466. # define __STLSOFT_CF_ASSERT_SUPPORT
  467. # define STLSOFT_CF_ASSERT_SUPPORT
  468. # define STLSOFT_ASSERT(_x) _STLSOFT_CUSTOM_ASSERT(_x)
  469. # if defined(_STLSOFT_CUSTOM_ASSERT_INCLUDE)
  470. # define __STLSOFT_CF_ASSERT_INCLUDE_NAME _STLSOFT_CUSTOM_ASSERT_INCLUDE
  471. # else
  472. # error You must define _STLSOFT_CUSTOM_ASSERT_INCLUDE along with _STLSOFT_CUSTOM_ASSERT()
  473. # endif /* !_STLSOFT_CUSTOM_ASSERT_INCLUDE */
  474. #else /* ? _STLSOFT_CUSTOM_ASSERT */
  475. # define __STLSOFT_CF_ASSERT_SUPPORT
  476. # define STLSOFT_CF_ASSERT_SUPPORT
  477. /* # define __STLSOFT_CF_USE_cassert */
  478. # define __STLSOFT_CF_ASSERT_INCLUDE_NAME <assert.h>
  479. # define STLSOFT_ASSERT(_x) assert(_x)
  480. #endif /* _STLSOFT_CUSTOM_ASSERT */
  481. /* /////////////////////////////////////////////////////////////////////////
  482. * Compiler warning suppression
  483. */
  484. /* /////////////////////////////////////////////////////////////////////////
  485. * Obsolete features
  486. */
  487. #include <stlsoft/internal/cccap/obsolete.h>
  488. /* ///////////////////////////// end of file //////////////////////////// */