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.

455 lines
14 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: stlsoft/internal/cccap/unknown.h
  3. *
  4. * Purpose: Compiler feature discrimination for unknown compilers.
  5. *
  6. * Created: 7th February 2003
  7. * Updated: 3rd February 2012
  8. *
  9. * Home: http://stlsoft.org/
  10. *
  11. * Copyright (c) 2003-2012, Matthew Wilson and Synesis Software
  12. * All rights reserved.
  13. *
  14. * Redistribution and use in source and binary forms, with or without
  15. * modification, are permitted provided that the following conditions are met:
  16. *
  17. * - Redistributions of source code must retain the above copyright notice, this
  18. * list of conditions and the following disclaimer.
  19. * - Redistributions in binary form must reproduce the above copyright notice,
  20. * this list of conditions and the following disclaimer in the documentation
  21. * and/or other materials provided with the distribution.
  22. * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
  23. * any contributors may be used to endorse or promote products derived from
  24. * this software without specific prior written permission.
  25. *
  26. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  27. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  28. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  29. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  30. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  31. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  32. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  33. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  34. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  35. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  36. * POSSIBILITY OF SUCH DAMAGE.
  37. *
  38. * ////////////////////////////////////////////////////////////////////// */
  39. #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
  40. # error This file must not be included independently of stlsoft/stlsoft.h
  41. #endif /* !STLSOFT_INCL_STLSOFT_H_STLSOFT */
  42. /** \file stlsoft/internal/cccap/unknown.h
  43. *
  44. * Compiler feature discrimination for unknown compilers
  45. * (\ref group__library__internal).
  46. */
  47. #ifdef STLSOFT_INCL_H_STLSOFT_CCCAP_UNKNOWN
  48. # error This file cannot be included more than once in any compilation unit
  49. #endif /* STLSOFT_INCL_H_STLSOFT_CCCAP_UNKNOWN */
  50. /* ////////////////////////////////////////////////////////////////////// */
  51. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  52. # define STLSOFT_VER_H_STLSOFT_CCCAP_UNKNOWN_MAJOR 3
  53. # define STLSOFT_VER_H_STLSOFT_CCCAP_UNKNOWN_MINOR 16
  54. # define STLSOFT_VER_H_STLSOFT_CCCAP_UNKNOWN_REVISION 2
  55. # define STLSOFT_VER_H_STLSOFT_CCCAP_UNKNOWN_EDIT 68
  56. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  57. /* /////////////////////////////////////////////////////////////////////////
  58. * Auto-generation and compatibility
  59. */
  60. /*
  61. [<[STLSOFT-AUTO:NO-DOCFILELABEL]>]
  62. [<[STLSOFT-AUTO:NO-UNITTEST]>]
  63. */
  64. /* /////////////////////////////////////////////////////////////////////////
  65. * Pre-processing features
  66. */
  67. /* Messaging
  68. */
  69. /* #define STLSOFT_CF_PRAGMA_MESSAGE_SUPPORT */
  70. /* Support for #pragma once
  71. */
  72. /* #define STLSOFT_CF_PRAGMA_ONCE_SUPPORT */
  73. /* Support for __FUNCTION__
  74. */
  75. /* #define STLSOFT_CF_FUNCTION_SYMBOL_SUPPORT */
  76. /* /////////////////////////////////////////////////////////////////////////
  77. * C/C++ Language features
  78. */
  79. /* Variadic Macros
  80. */
  81. #define STLSOFT_CF_SUPPORTS_VARIADIC_MACROS
  82. /* Anonymous unions
  83. */
  84. #define STLSOFT_CF_ANONYMOUS_UNION_SUPPORT
  85. /* "return void;"
  86. */
  87. #define STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID
  88. /* /////////////////////////////////////////////////////////////////////////
  89. * Types
  90. */
  91. /* bool */
  92. #ifdef __cplusplus
  93. # define STLSOFT_CF_NATIVE_BOOL_SUPPORT
  94. #endif /* __cplusplus */
  95. /* wchar_t */
  96. #define STLSOFT_CF_NATIVE_WCHAR_T_SUPPORT
  97. /* ////////////////////////////////////////////////////////////////////// */
  98. /* ////////////////////////////////////////////////////////////////////// */
  99. /* ////////////////////////////////////////////////////////////////////// */
  100. /* ////////////////////////////////////////////////////////////////////// */
  101. /* ////////////////////////////////////////////////////////////////////// */
  102. /* ////////////////////////////////////////////////////////////////////// */
  103. /* ////////////////////////////////////////////////////////////////////// */
  104. /* ////////////////////////////////////////////////////////////////////// */
  105. /* ////////////////////////////////////////////////////////////////////// */
  106. /* ////////////////////////////////////////////////////////////////////// */
  107. /* ///////////////////////////////////////////////
  108. * Integral types
  109. *
  110. * The purpose of this section is to define the following types:
  111. *
  112. * - 8-bit signed and unsigned integers
  113. * - 16-bit signed and unsigned integers
  114. * - 32-bit signed and unsigned integers
  115. * - (optionally) 64-bit signed and unsigned integers
  116. *
  117. * and to define, where appropriate the following symbols (used for
  118. * overloading):
  119. *
  120. * - STLSOFT_CF_CHAR_DISTINCT_INT_TYPE
  121. * - STLSOFT_CF_SHORT_DISTINCT_INT_TYPE
  122. * - STLSOFT_CF_INT_DISTINCT_INT_TYPE
  123. * - STLSOFT_CF_LONG_DISTINCT_INT_TYPE
  124. * - STLSOFT_CF_LONG_LONG_DISTINCT_INT_TYPE
  125. *
  126. * which indicate that a given type is not used in the size-specific types.
  127. */
  128. #if defined(__LP64__)
  129. # define _STLSOFT_SIZEOF_CHAR (1)
  130. # define _STLSOFT_SIZEOF_SHORT (2)
  131. # define _STLSOFT_SIZEOF_INT (4)
  132. # define _STLSOFT_SIZEOF_LONG (8)
  133. # define _STLSOFT_SIZEOF_LONG_LONG (8)
  134. #else /* ? data model */
  135. # define _STLSOFT_SIZEOF_CHAR (1)
  136. # define _STLSOFT_SIZEOF_SHORT (2)
  137. # define _STLSOFT_SIZEOF_INT (4)
  138. # define _STLSOFT_SIZEOF_LONG (4)
  139. # define _STLSOFT_SIZEOF_LONG_LONG (8)
  140. #endif /* data model */
  141. /* 8-bit integer */
  142. #define STLSOFT_CF_8BIT_INT_SUPPORT
  143. #define STLSOFT_SI08_T_BASE_TYPE signed char
  144. #define STLSOFT_UI08_T_BASE_TYPE unsigned char
  145. /* 16-bit integer */
  146. #define STLSOFT_CF_16BIT_INT_SUPPORT
  147. #define STLSOFT_SI16_T_BASE_TYPE signed short
  148. #define STLSOFT_UI16_T_BASE_TYPE unsigned short
  149. /* 32-bit integer */
  150. #define STLSOFT_CF_32BIT_INT_SUPPORT
  151. #define STLSOFT_SI32_T_BASE_TYPE signed int
  152. #define STLSOFT_UI32_T_BASE_TYPE unsigned int
  153. #define STLSOFT_CF_LONG_DISTINCT_INT_TYPE
  154. /* 64-bit integer */
  155. #define STLSOFT_CF_64BIT_INT_SUPPORT
  156. #define STLSOFT_SI64_T_BASE_TYPE signed long long
  157. #define STLSOFT_UI64_T_BASE_TYPE unsigned long long
  158. /* /////////////////////////////////////////////////////////////////////////
  159. * C++ Language Features
  160. */
  161. /* ///////////////////////////////////////////////
  162. * Miscellaneous
  163. */
  164. /* Does the compiler support Argument-Dependent Lookup? */
  165. #define STLSOFT_CF_ADL_LOOKUP_SUPPORT
  166. /* ///////////////////////////////////////////////
  167. * Static array size determination
  168. */
  169. #define STLSOFT_CF_STATIC_ARRAY_SIZE_DETERMINATION_SUPPORT
  170. /* ///////////////////////////////////////////////
  171. * C++-98 keywords support
  172. */
  173. #define STLSOFT_CF_EXPLICIT_KEYWORD_SUPPORT
  174. #define STLSOFT_CF_MUTABLE_KEYWORD_SUPPORT
  175. #define STLSOFT_CF_TYPENAME_PARAM_KEYWORD_SUPPORT
  176. #define STLSOFT_CF_TYPENAME_TYPE_KEYWORD_SUPPORT
  177. #define STLSOFT_CF_TYPENAME_TYPE_DEF_KEYWORD_SUPPORT
  178. #define STLSOFT_CF_TYPENAME_TYPE_MIL_KEYWORD_SUPPORT
  179. #define STLSOFT_CF_TYPENAME_TYPE_RET_KEYWORD_SUPPORT
  180. /* ///////////////////////////////////////////////
  181. * RTTI support
  182. */
  183. #ifdef __cplusplus
  184. # define STLSOFT_CF_RTTI_SUPPORT
  185. #endif /* __cplusplus */
  186. /* ///////////////////////////////////////////////
  187. * Exception support
  188. */
  189. #ifdef __cplusplus
  190. # define STLSOFT_CF_EXCEPTION_SUPPORT
  191. #endif /* __cplusplus */
  192. #define STLSOFT_CF_EXCEPTION_SIGNATURE_SUPPORT
  193. /* #define STLSOFT_CF_EXCEPTION_SPEC_EXPENSIVE */
  194. #define STLSOFT_CF_THROW_BAD_ALLOC
  195. /* ///////////////////////////////////////////////
  196. * Namespace support
  197. */
  198. /* Can the compiler support namespaces? */
  199. #ifdef __cplusplus
  200. # define STLSOFT_CF_NAMESPACE_SUPPORT
  201. #endif /* __cplusplus */
  202. /* Should we allow the STLSoft libraries to be defined within a namespace? */
  203. /* #define _STLSOFT_NO_NAMESPACES */
  204. /* Does the C++ standard library exist within the std namespace */
  205. /* TODO: Move this out of here, and change to STLSOFT_LF_std_NAMESPACE */
  206. #define STLSOFT_CF_std_NAMESPACE
  207. /* */
  208. #define STLSOFT_CF_FUNCTION_SIGNATURE_FULL_ARG_QUALIFICATION_REQUIRED
  209. /* Template support */
  210. #define STLSOFT_CF_TEMPLATE_SUPPORT
  211. /* #define STLSOFT_CF_TEMPLATE_TYPE_REQUIRED_IN_ARGS */
  212. #define STLSOFT_CF_TEMPLATE_CLASS_DEFAULT_FUNDAMENTAL_ARGUMENT_SUPPORT
  213. #define STLSOFT_CF_TEMPLATE_CLASS_DEFAULT_CLASS_ARGUMENT_SUPPORT
  214. #define STLSOFT_CF_MEM_FUNC_AS_TEMPLATE_PARAM_SUPPORT
  215. #define STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT
  216. #define STLSOFT_CF_MEMBER_TEMPLATE_OVERLOAD_DISCRIMINATED
  217. #define STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT
  218. #define STLSOFT_CF_MEMBER_TEMPLATE_CTOR_OVERLOAD_DISCRIMINATED
  219. #define STLSOFT_CF_MEMBER_TEMPLATE_RANGE_METHOD_SUPPORT
  220. #define STLSOFT_CF_MEMBER_TEMPLATE_CLASS_SUPPORT
  221. #define STLSOFT_CF_TEMPLATE_SPECIALISATION_SYNTAX
  222. #define STLSOFT_CF_TEMPLATE_PARTIAL_SPECIALISATION_SUPPORT
  223. #define STLSOFT_CF_TEMPLATE_OUTOFCLASSFN_QUALIFIED_TYPE_SUPPORT
  224. #define STLSOFT_CF_std_char_traits_AVAILABLE
  225. #define STLSOFT_CF_PARENT_TYPES_CAN_BE_USED_IN_NON_TEMPLATE
  226. #define STLSOFT_CF_PARENT_TYPES_CAN_BE_USED_IN_TEMPLATE
  227. #define STLSOFT_CF_TEMPLATE_QUALIFIER_KEYWORD_SUPPORT
  228. #define STLSOFT_CF_TEMPLATE_TEMPLATE_SUPPORT
  229. /* #define STLSOFT_CF_MOVE_CONSTRUCTOR_SUPPORT */
  230. #define STLSOFT_CF_VENEER_SUPPORT
  231. /* #define STLSOFT_CF_ALLOCATOR_BASE_EXPENSIVE */
  232. /* #define STLSOFT_CF_COMPILER_WARNS_NO_PUBLIC_DTOR */
  233. /* Shims are assumed to be supported. */
  234. /* #define STLSOFT_CF_TEMPLATE_SHIMS_NOT_SUPPORTED */
  235. /* This cannot be assumed. */
  236. /* #define STLSOFT_CF_NEGATIVE_MODULUS_POSITIVE_GIVES_NEGATIVE_RESULT */
  237. /*
  238. * class X
  239. * {
  240. * #ifdef STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT
  241. * private:
  242. * struct boolean { int i; };
  243. * public:
  244. * operator int boolean::* () const
  245. * {
  246. * return <internal condition> ? &boolean::i : NULL;
  247. * }
  248. * #else // ? STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT
  249. * public:
  250. * operator bool() const
  251. * {
  252. * return <internal condition>;
  253. * }
  254. * #endif // STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT
  255. * #if !defined(STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT) || \
  256. * !defined(STLSOFT_CF_OPERATOR_NOT_VIA_OPERATOR_POINTER_TO_MEMBER_SUPPORT)
  257. * public:
  258. * bool operator !() const
  259. * {
  260. * # ifdef STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT
  261. * return NULL == operator int boolean::*();
  262. * # else // ? STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT
  263. * return !operator bool();
  264. * # endif // STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT
  265. * }
  266. * #endif // !STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT || !STLSOFT_CF_OPERATOR_NOT_VIA_OPERATOR_POINTER_TO_MEMBER_SUPPORT
  267. *
  268. */
  269. /* These cannot be assumed. */
  270. /* #define STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT */
  271. /* #define STLSOFT_CF_OPERATOR_NOT_VIA_OPERATOR_POINTER_TO_MEMBER_SUPPORT */
  272. #define STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT
  273. /* #define STLSOFT_CF_OPERATOR_NOT_VIA_OPERATOR_POINTER_TO_MEMBER_SUPPORT */
  274. /* /////////////////////////////////////////////////////////////////////////
  275. * Quality assurance features
  276. */
  277. /* Dynamic assert:
  278. */
  279. #if defined(_STLSOFT_CUSTOM_ASSERT)
  280. /* You have defined the preprocessor symbol _STLSOFT_CUSTOM_ASSERT,
  281. * which stipulates that you will be providing your own assert. This
  282. * requires that you have defined _STLSOFT_CUSTOM_ASSERT() as a macro
  283. * taking 1 parameter (the condition to assert).
  284. *
  285. * Suppose you have a function DisplayAssert_(), which has the
  286. * following signature:
  287. *
  288. * void DisplayAssert_(char const* file, int line, char const* expression);
  289. *
  290. * Presumably you would also have your own assert macro, say MY_ASSERT(),
  291. * defined as:
  292. *
  293. * #define MY_ASSERT(_x) ((void)((!(_x)) ? ((void)(DisplayAssert_(__FILE__, __LINE__, #_x))) : ((void)0)))
  294. *
  295. * so you would simply need to define _STLSOFT_CUSTOM_ASSERT() in terms of
  296. * MY_ASSERT(), as in:
  297. *
  298. * #define _STLSOFT_CUSTOM_ASSERT(_x) MY_ASSERT(_x)
  299. *
  300. * where
  301. */
  302. # define __STLSOFT_CF_ASSERT_SUPPORT
  303. # define STLSOFT_CF_ASSERT_SUPPORT
  304. # define STLSOFT_ASSERT(_x) _STLSOFT_CUSTOM_ASSERT(_x)
  305. # if defined(_STLSOFT_CUSTOM_ASSERT_INCLUDE)
  306. # define __STLSOFT_CF_ASSERT_INCLUDE_NAME _STLSOFT_CUSTOM_ASSERT_INCLUDE
  307. # else
  308. # error You must define _STLSOFT_CUSTOM_ASSERT_INCLUDE along with _STLSOFT_CUSTOM_ASSERT()
  309. # endif /* !_STLSOFT_CUSTOM_ASSERT_INCLUDE */
  310. #else /* ? _STLSOFT_CUSTOM_ASSERT */
  311. # define __STLSOFT_CF_ASSERT_SUPPORT
  312. # define STLSOFT_CF_ASSERT_SUPPORT
  313. # define __STLSOFT_CF_USE_cassert
  314. #endif /* _STLSOFT_CUSTOM_ASSERT */
  315. /* Static assert:
  316. */
  317. #define STLSOFT_CF_STATIC_ASSERT_SUPPORT
  318. /* TODO: define here whether need -1 or 0 as the static assert invalid array quantifier */
  319. /* /////////////////////////////////////////////////////////////////////////
  320. * Calling convention
  321. */
  322. #define STLSOFT_CF_CDECL_SUPPORTED
  323. /* #define STLSOFT_CF_FASTCALL_SUPPORTED */
  324. /* #define STLSOFT_CF_STDCALL_SUPPORTED */
  325. #define STLSOFT_CDECL
  326. /* #define STLSOFT_CDECL __cdecl */
  327. /* #define STLSOFT_FASTCALL __fastcall */
  328. /* #define STLSOFT_STDCALL __stdcall */
  329. /* /////////////////////////////////////////////////////////////////////////
  330. * Inline assembler
  331. */
  332. /* #define STSLSOFT_INLINE_ASM_SUPPORTED */
  333. /* #define STSLSOFT_ASM_IN_INLINE_SUPPORTED */
  334. /* /////////////////////////////////////////////////////////////////////////
  335. * inline support
  336. */
  337. #if defined(_WIN32) && \
  338. defined(_MSC_VER)
  339. /* Special case when "forcing" any compiler on Win32 using VC++ in order
  340. * to emulate UNIX compilation
  341. */
  342. # define STLSOFT_CUSTOM_C_INLINE __inline
  343. #else /* ? environment */
  344. # define STLSOFT_CF_C99_INLINE
  345. #endif /* environment */
  346. /* /////////////////////////////////////////////////////////////////////////
  347. * Compiler warning suppression
  348. */
  349. /* ///////////////////////////// end of file //////////////////////////// */