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.

422 lines
13 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: stlsoft/internal/cccap/mwerks.h
  3. *
  4. * Purpose: Compiler feature discrimination for Metrowerks CodeWarrior.
  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/mwerks.h
  43. *
  44. * Compiler feature discrimination for Metrowerks CodeWarrior
  45. * (\ref group__library__internal).
  46. */
  47. #ifdef STLSOFT_INCL_H_STLSOFT_CCCAP_MWERKS
  48. # error This file cannot be included more than once in any compilation unit
  49. #endif /* STLSOFT_INCL_H_STLSOFT_CCCAP_MWERKS */
  50. /* ////////////////////////////////////////////////////////////////////// */
  51. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  52. # define STLSOFT_VER_H_STLSOFT_CCCAP_MWERKS_MAJOR 3
  53. # define STLSOFT_VER_H_STLSOFT_CCCAP_MWERKS_MINOR 18
  54. # define STLSOFT_VER_H_STLSOFT_CCCAP_MWERKS_REVISION 2
  55. # define STLSOFT_VER_H_STLSOFT_CCCAP_MWERKS_EDIT 74
  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. * Compiler 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. #if (__MWERKS__ & 0xFF00) >= 0x3000
  76. # define STLSOFT_CF_FUNCTION_SYMBOL_SUPPORT
  77. #else /* ? compiler */
  78. /* Not defined */
  79. #endif /* compiler */
  80. /* Variadic Macros
  81. */
  82. #if (__MWERKS__ & 0xFF00) >= 0x3000
  83. # define STLSOFT_CF_SUPPORTS_VARIADIC_MACROS
  84. #else /* ? compiler */
  85. /* Not defined */
  86. #endif /* compiler */
  87. /* Types:
  88. */
  89. /* bool */
  90. #if __option(bool)
  91. # define STLSOFT_CF_NATIVE_BOOL_SUPPORT
  92. #else
  93. /* Not defined */
  94. #endif /* __option(bool) */
  95. /* char (sign) */
  96. #if 0 /* Does not seem to work ?? */
  97. #if __option(chars_unsigned)
  98. # define STLSOFT_CF_CHAR_IS_UNSIGNED
  99. #endif /* _CHAR_UNSIGNED */
  100. #endif /* 0 */
  101. /* wchar_t */
  102. # if __option(wchar_type)
  103. # define STLSOFT_CF_NATIVE_WCHAR_T_SUPPORT
  104. # else
  105. /* Not defined */
  106. # endif /* __option(wchar_type) */
  107. /* ////////////////////////////////////////////////////////////////////// */
  108. /* ////////////////////////////////////////////////////////////////////// */
  109. /* ////////////////////////////////////////////////////////////////////// */
  110. /* ////////////////////////////////////////////////////////////////////// */
  111. /* ////////////////////////////////////////////////////////////////////// */
  112. /* ////////////////////////////////////////////////////////////////////// */
  113. /* ////////////////////////////////////////////////////////////////////// */
  114. /* ////////////////////////////////////////////////////////////////////// */
  115. /* ////////////////////////////////////////////////////////////////////// */
  116. /* ////////////////////////////////////////////////////////////////////// */
  117. /* /////////////////////////////////////////////////////////////////////////
  118. * Integral types
  119. *
  120. * The purpose of this section is to define the following types:
  121. *
  122. * - 8-bit signed and unsigned integers
  123. * - 16-bit signed and unsigned integers
  124. * - 32-bit signed and unsigned integers
  125. * - (optionally) 64-bit signed and unsigned integers
  126. *
  127. * and to define, where appropriate the following symbols (used for
  128. * overloading):
  129. *
  130. * - STLSOFT_CF_CHAR_DISTINCT_INT_TYPE
  131. * - STLSOFT_CF_SHORT_DISTINCT_INT_TYPE
  132. * - STLSOFT_CF_INT_DISTINCT_INT_TYPE
  133. * - STLSOFT_CF_LONG_DISTINCT_INT_TYPE
  134. * - STLSOFT_CF_LONG_LONG_DISTINCT_INT_TYPE
  135. *
  136. * which indicate that a given type is not used in the size-specific types.
  137. */
  138. #if defined(__LP64__)
  139. # define _STLSOFT_SIZEOF_CHAR (1)
  140. # define _STLSOFT_SIZEOF_SHORT (2)
  141. # define _STLSOFT_SIZEOF_INT (4)
  142. # define _STLSOFT_SIZEOF_LONG (8)
  143. # define _STLSOFT_SIZEOF_LONG_LONG (8)
  144. #elif defined(_WIN32) || \
  145. defined(_WIN64)
  146. # define _STLSOFT_SIZEOF_CHAR (1)
  147. # define _STLSOFT_SIZEOF_SHORT (2)
  148. # define _STLSOFT_SIZEOF_INT (4)
  149. # define _STLSOFT_SIZEOF_LONG (4)
  150. # define _STLSOFT_SIZEOF_LONG_LONG (8)
  151. #else /* ? data model */
  152. # error Use of CodeWarrior has not been verified on any operation system other than Win32. Please contact Synesis Software
  153. #endif /* data model */
  154. /* 8-bit integer */
  155. #define STLSOFT_CF_8BIT_INT_SUPPORT
  156. #define STLSOFT_SI08_T_BASE_TYPE signed char
  157. #define STLSOFT_UI08_T_BASE_TYPE unsigned char
  158. /* 16-bit integer */
  159. #define STLSOFT_CF_16BIT_INT_SUPPORT
  160. #define STLSOFT_SI16_T_BASE_TYPE signed short
  161. #define STLSOFT_UI16_T_BASE_TYPE unsigned short
  162. /* 32-bit integer */
  163. #define STLSOFT_CF_32BIT_INT_SUPPORT
  164. #define STLSOFT_SI32_T_BASE_TYPE signed int
  165. #define STLSOFT_UI32_T_BASE_TYPE unsigned int
  166. #define STLSOFT_CF_LONG_DISTINCT_INT_TYPE
  167. /* 64-bit integer */
  168. #if __option(longlong)
  169. # define STLSOFT_CF_64BIT_INT_IS_long_long
  170. #endif /* __option(longlong) */
  171. #ifdef STLSOFT_CF_64BIT_INT_IS_long_long
  172. # define STLSOFT_CF_64BIT_INT_SUPPORT
  173. # define STLSOFT_SI64_T_BASE_TYPE signed long long
  174. # define STLSOFT_UI64_T_BASE_TYPE unsigned long long
  175. #endif /* STLSOFT_CF_64BIT_INT_IS_long_long */
  176. /* Member constants */
  177. #define STLSOFT_CF_MEMBER_CONSTANT_SUPPORT
  178. /* Static assertions */
  179. #define STLSOFT_CF_STATIC_ASSERT_SUPPORT
  180. /* RTTI support */
  181. #if __option(RTTI)
  182. # define STLSOFT_CF_RTTI_SUPPORT
  183. #else
  184. /* Not defined */
  185. #endif /* __option(RTTI) */
  186. /* Exception support */
  187. #if __option(exceptions) && \
  188. defined(__cplusplus)
  189. # define STLSOFT_CF_EXCEPTION_SUPPORT
  190. #else
  191. /* Not defined */
  192. #endif /* __option(exceptions) && __cplusplus */
  193. /* */
  194. #define STLSOFT_CF_FUNCTION_SIGNATURE_FULL_ARG_QUALIFICATION_REQUIRED
  195. /* Namespace support */
  196. /* #define _STLSOFT_NO_NAMESPACES */
  197. #ifdef __cplusplus
  198. # define STLSOFT_CF_NAMESPACE_SUPPORT
  199. #endif /* __cplusplus */
  200. #define STLSOFT_CF_ANONYMOUS_UNION_SUPPORT
  201. #define STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID
  202. /* Template support */
  203. #if __option(ecplusplus)
  204. /* Not defined */
  205. #else
  206. # define STLSOFT_CF_TEMPLATE_SUPPORT
  207. #endif /* __option(ecplusplus) */
  208. /* #define STLSOFT_CF_TEMPLATE_TYPE_REQUIRED_IN_ARGS */
  209. #define STLSOFT_CF_EXCEPTION_SIGNATURE_SUPPORT
  210. /* #define STLSOFT_CF_EXCEPTION_SPEC_EXPENSIVE */
  211. #define STLSOFT_CF_THROW_BAD_ALLOC
  212. #define STLSOFT_CF_TEMPLATE_CLASS_DEFAULT_FUNDAMENTAL_ARGUMENT_SUPPORT
  213. #define STLSOFT_CF_TEMPLATE_CLASS_DEFAULT_CLASS_ARGUMENT_SUPPORT
  214. #if (__MWERKS__ & 0xFF00) >= 0x3000
  215. # define STLSOFT_CF_MEM_FUNC_AS_TEMPLATE_PARAM_SUPPORT
  216. #else /* ? compiler */
  217. /* Not defined */
  218. #endif /* compiler */
  219. #define STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT
  220. #define STLSOFT_CF_MEMBER_TEMPLATE_OVERLOAD_DISCRIMINATED
  221. #define STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT
  222. #define STLSOFT_CF_MEMBER_TEMPLATE_CTOR_OVERLOAD_DISCRIMINATED
  223. #define STLSOFT_CF_MEMBER_TEMPLATE_RANGE_METHOD_SUPPORT
  224. #define STLSOFT_CF_MEMBER_TEMPLATE_CLASS_SUPPORT
  225. #define STLSOFT_CF_TEMPLATE_SPECIALISATION_SYNTAX
  226. #define STLSOFT_CF_TEMPLATE_PARTIAL_SPECIALISATION_SUPPORT
  227. #define STLSOFT_CF_TEMPLATE_OUTOFCLASSFN_QUALIFIED_TYPE_SUPPORT
  228. #define STLSOFT_CF_std_NAMESPACE
  229. #define STLSOFT_CF_std_char_traits_AVAILABLE
  230. #define STLSOFT_CF_PARENT_TYPES_CAN_BE_USED_IN_NON_TEMPLATE
  231. #define STLSOFT_CF_PARENT_TYPES_CAN_BE_USED_IN_TEMPLATE
  232. #define STLSOFT_CF_EXPLICIT_KEYWORD_SUPPORT
  233. #define STLSOFT_CF_MUTABLE_KEYWORD_SUPPORT
  234. #define STLSOFT_CF_TYPENAME_PARAM_KEYWORD_SUPPORT
  235. #define STLSOFT_CF_TYPENAME_TYPE_KEYWORD_SUPPORT
  236. #define STLSOFT_CF_TYPENAME_TYPE_DEF_KEYWORD_SUPPORT
  237. /* #define STLSOFT_CF_TYPENAME_TYPE_MIL_KEYWORD_SUPPORT */
  238. #define STLSOFT_CF_TYPENAME_TYPE_RET_KEYWORD_SUPPORT
  239. /* #define STLSOFT_CF_TEMPLATE_QUALIFIER_KEYWORD_SUPPORT */
  240. /* #define STLSOFT_CF_MOVE_CONSTRUCTOR_SUPPORT */
  241. #define STLSOFT_CF_ADL_LOOKUP_SUPPORT
  242. #define STLSOFT_CF_TEMPLATE_TEMPLATE_SUPPORT
  243. #define STLSOFT_CF_STATIC_ARRAY_SIZE_DETERMINATION_SUPPORT
  244. #define STLSOFT_CF_VENEER_SUPPORT
  245. #define STLSOFT_CF_ALLOCATOR_BASE_EXPENSIVE
  246. /* #define STLSOFT_CF_COMPILER_WARNS_NO_PUBLIC_DTOR */
  247. /* Shims are supported. */
  248. /* #define STLSOFT_CF_TEMPLATE_SHIMS_NOT_SUPPORTED */
  249. #define STLSOFT_CF_NEGATIVE_MODULUS_POSITIVE_GIVES_NEGATIVE_RESULT
  250. #define STLSOFT_CF_OPERATOR_BOOL_AS_OPERATOR_POINTER_TO_MEMBER_SUPPORT
  251. #define STLSOFT_CF_OPERATOR_NOT_VIA_OPERATOR_POINTER_TO_MEMBER_SUPPORT
  252. /* /////////////////////////////////////////////////////////////////////////
  253. * Quality assurance features
  254. */
  255. #if defined(_STLSOFT_CUSTOM_ASSERT)
  256. /* You have defined the preprocessor symbol _STLSOFT_CUSTOM_ASSERT,
  257. * which stipulates that you will be providing your own assert. This
  258. * requires that you have defined _STLSOFT_CUSTOM_ASSERT() as a macro
  259. * taking 1 parameter (the condition to assert).
  260. *
  261. * Suppose you have a function DisplayAssert_(), which has the
  262. * following signature:
  263. *
  264. * void DisplayAssert_(char const* file, int line, char const* expression);
  265. *
  266. * Presumably you would also have your own assert macro, say MY_ASSERT(),
  267. * defined as:
  268. *
  269. * #define MY_ASSERT(_x) ((void)((!(_x)) ? ((void)(DisplayAssert_(__FILE__, __LINE__, #_x))) : ((void)0)))
  270. *
  271. * so you would simply need to define _STLSOFT_CUSTOM_ASSERT() in terms of
  272. * MY_ASSERT(), as in:
  273. *
  274. * #define _STLSOFT_CUSTOM_ASSERT(_x) MY_ASSERT(_x)
  275. *
  276. * where
  277. */
  278. # define __STLSOFT_CF_ASSERT_SUPPORT
  279. # define STLSOFT_CF_ASSERT_SUPPORT
  280. # define STLSOFT_ASSERT(_x) _STLSOFT_CUSTOM_ASSERT(_x)
  281. # if defined(_STLSOFT_CUSTOM_ASSERT_INCLUDE)
  282. # define __STLSOFT_CF_ASSERT_INCLUDE_NAME _STLSOFT_CUSTOM_ASSERT_INCLUDE
  283. # else
  284. # error You must define _STLSOFT_CUSTOM_ASSERT_INCLUDE along with _STLSOFT_CUSTOM_ASSERT()
  285. # endif /* !_STLSOFT_CUSTOM_ASSERT_INCLUDE */
  286. #else /* ? _STLSOFT_CUSTOM_ASSERT */
  287. # define __STLSOFT_CF_ASSERT_SUPPORT
  288. # define STLSOFT_CF_ASSERT_SUPPORT
  289. # define __STLSOFT_CF_USE_cassert
  290. #endif /* _STLSOFT_CUSTOM_ASSERT */
  291. /* /////////////////////////////////////////////////////////////////////////
  292. * Calling convention
  293. */
  294. #define STLSOFT_CF_CDECL_SUPPORTED
  295. #if defined(_WIN32)
  296. # define STLSOFT_CF_THISCALL_SUPPORTED
  297. # define STLSOFT_CF_FASTCALL_SUPPORTED
  298. # define STLSOFT_CF_STDCALL_SUPPORTED
  299. # ifdef STLSOFT_CF_CDECL_SUPPORTED
  300. # define STLSOFT_CDECL __cdecl
  301. # endif /* STLSOFT_CF_CDECL_SUPPORTED */
  302. # ifdef STLSOFT_CF_FASTCALL_SUPPORTED
  303. # define STLSOFT_FASTCALL __fastcall
  304. # endif /* STLSOFT_CF_FASTCALL_SUPPORTED */
  305. # ifdef STLSOFT_CF_STDCALL_SUPPORTED
  306. # define STLSOFT_STDCALL __stdcall
  307. # endif /* STLSOFT_CF_STDCALL_SUPPORTED */
  308. #else /* ? UNIX */
  309. # ifdef STLSOFT_CF_CDECL_SUPPORTED
  310. # define STLSOFT_CDECL
  311. # endif /* STLSOFT_CF_CDECL_SUPPORTED */
  312. #endif /* !unix && !__unix__ */
  313. /* /////////////////////////////////////////////////////////////////////////
  314. * Inline assembler
  315. */
  316. #define STSLSOFT_INLINE_ASM_SUPPORTED
  317. #if (__MWERKS__ & 0xFF00) >= 0x3000
  318. # define STSLSOFT_ASM_IN_INLINE_SUPPORTED
  319. #else /* ? compiler */
  320. /* Not defined */
  321. #endif /* compiler */
  322. /* /////////////////////////////////////////////////////////////////////////
  323. * inline support
  324. */
  325. #define STLSOFT_CF_C99_INLINE
  326. /* /////////////////////////////////////////////////////////////////////////
  327. * Compiler warning suppression
  328. */
  329. /* ///////////////////////////// end of file //////////////////////////// */