codegear.hpp 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. // (C) Copyright John Maddock 2001 - 2003.
  2. // (C) Copyright David Abrahams 2002 - 2003.
  3. // (C) Copyright Aleksey Gurtovoy 2002.
  4. // Use, modification and distribution are subject to the
  5. // Boost Software License, Version 1.0. (See accompanying file
  6. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. // See http://www.boost.org for most recent version.
  8. // CodeGear C++ compiler setup:
  9. #if !defined( BOOST_WITH_CODEGEAR_WARNINGS )
  10. // these warnings occur frequently in optimized template code
  11. # pragma warn -8004 // var assigned value, but never used
  12. # pragma warn -8008 // condition always true/false
  13. # pragma warn -8066 // dead code can never execute
  14. # pragma warn -8104 // static members with ctors not threadsafe
  15. # pragma warn -8105 // reference member in class without ctors
  16. #endif
  17. //
  18. // versions check:
  19. // last known and checked version is 0x621
  20. #if (__CODEGEARC__ > 0x621)
  21. # if defined(BOOST_ASSERT_CONFIG)
  22. # error "boost: Unknown compiler version - please run the configure tests and report the results"
  23. # else
  24. # pragma message( "boost: Unknown compiler version - please run the configure tests and report the results")
  25. # endif
  26. #endif
  27. // CodeGear C++ Builder 2009
  28. #if (__CODEGEARC__ <= 0x613)
  29. # define BOOST_NO_INTEGRAL_INT64_T
  30. # define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
  31. # define BOOST_NO_PRIVATE_IN_AGGREGATE
  32. # define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
  33. // we shouldn't really need this - but too many things choke
  34. // without it, this needs more investigation:
  35. # define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
  36. # define BOOST_SP_NO_SP_CONVERTIBLE
  37. #endif
  38. // CodeGear C++ Builder 2010
  39. #if (__CODEGEARC__ <= 0x621)
  40. # define BOOST_NO_TYPENAME_WITH_CTOR // Cannot use typename keyword when making temporaries of a dependant type
  41. # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
  42. # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
  43. # define BOOST_NO_NESTED_FRIENDSHIP // TC1 gives nested classes access rights as any other member
  44. # define BOOST_NO_USING_TEMPLATE
  45. # define BOOST_NO_TWO_PHASE_NAME_LOOKUP
  46. // Temporary hack, until specific MPL preprocessed headers are generated
  47. # define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
  48. // CodeGear has not yet completely implemented value-initialization, for
  49. // example for array types, as I reported in 2010: Embarcadero Report 83751,
  50. // "Value-initialization: arrays should have each element value-initialized",
  51. // http://qc.embarcadero.com/wc/qcmain.aspx?d=83751
  52. // Last checked version: Embarcadero C++ 6.21
  53. // See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
  54. // (Niels Dekker, LKEB, April 2010)
  55. # define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
  56. # if defined(NDEBUG) && defined(__cplusplus)
  57. // fix broken <cstring> so that Boost.test works:
  58. # include <cstring>
  59. # undef strcmp
  60. # endif
  61. // fix broken errno declaration:
  62. # include <errno.h>
  63. # ifndef errno
  64. # define errno errno
  65. # endif
  66. #endif
  67. // Reportedly, #pragma once is supported since C++ Builder 2010
  68. #if (__CODEGEARC__ >= 0x620)
  69. # define BOOST_HAS_PRAGMA_ONCE
  70. #endif
  71. //
  72. // C++0x macros:
  73. //
  74. #if (__CODEGEARC__ <= 0x620)
  75. #define BOOST_NO_CXX11_STATIC_ASSERT
  76. #else
  77. #define BOOST_HAS_STATIC_ASSERT
  78. #endif
  79. #define BOOST_HAS_CHAR16_T
  80. #define BOOST_HAS_CHAR32_T
  81. #define BOOST_HAS_LONG_LONG
  82. // #define BOOST_HAS_ALIGNOF
  83. #define BOOST_HAS_DECLTYPE
  84. #define BOOST_HAS_EXPLICIT_CONVERSION_OPS
  85. // #define BOOST_HAS_RVALUE_REFS
  86. #define BOOST_HAS_SCOPED_ENUM
  87. // #define BOOST_HAS_STATIC_ASSERT
  88. #define BOOST_HAS_STD_TYPE_TRAITS
  89. #define BOOST_NO_CXX11_AUTO_DECLARATIONS
  90. #define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
  91. #define BOOST_NO_CXX11_CONSTEXPR
  92. #define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
  93. #define BOOST_NO_CXX11_DELETED_FUNCTIONS
  94. #define BOOST_NO_CXX11_EXTERN_TEMPLATE
  95. #define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
  96. #define BOOST_NO_CXX11_LAMBDAS
  97. #define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
  98. #define BOOST_NO_CXX11_NOEXCEPT
  99. #define BOOST_NO_CXX11_NULLPTR
  100. #define BOOST_NO_CXX11_RANGE_BASED_FOR
  101. #define BOOST_NO_CXX11_RAW_LITERALS
  102. #define BOOST_NO_CXX11_RVALUE_REFERENCES
  103. #define BOOST_NO_SFINAE_EXPR
  104. #define BOOST_NO_CXX11_SFINAE_EXPR
  105. #define BOOST_NO_CXX11_TEMPLATE_ALIASES
  106. #define BOOST_NO_CXX11_UNICODE_LITERALS
  107. #define BOOST_NO_CXX11_VARIADIC_TEMPLATES
  108. #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
  109. #define BOOST_NO_CXX11_USER_DEFINED_LITERALS
  110. #define BOOST_NO_CXX11_ALIGNAS
  111. #define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
  112. #define BOOST_NO_CXX11_INLINE_NAMESPACES
  113. #define BOOST_NO_CXX11_REF_QUALIFIERS
  114. #define BOOST_NO_CXX11_FINAL
  115. #define BOOST_NO_CXX11_THREAD_LOCAL
  116. // C++ 14:
  117. #if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)
  118. # define BOOST_NO_CXX14_AGGREGATE_NSDMI
  119. #endif
  120. #if !defined(__cpp_binary_literals) || (__cpp_binary_literals < 201304)
  121. # define BOOST_NO_CXX14_BINARY_LITERALS
  122. #endif
  123. #if !defined(__cpp_constexpr) || (__cpp_constexpr < 201304)
  124. # define BOOST_NO_CXX14_CONSTEXPR
  125. #endif
  126. #if !defined(__cpp_decltype_auto) || (__cpp_decltype_auto < 201304)
  127. # define BOOST_NO_CXX14_DECLTYPE_AUTO
  128. #endif
  129. #if (__cplusplus < 201304) // There's no SD6 check for this....
  130. # define BOOST_NO_CXX14_DIGIT_SEPARATORS
  131. #endif
  132. #if !defined(__cpp_generic_lambdas) || (__cpp_generic_lambdas < 201304)
  133. # define BOOST_NO_CXX14_GENERIC_LAMBDAS
  134. #endif
  135. #if !defined(__cpp_init_captures) || (__cpp_init_captures < 201304)
  136. # define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
  137. #endif
  138. #if !defined(__cpp_return_type_deduction) || (__cpp_return_type_deduction < 201304)
  139. # define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
  140. #endif
  141. #if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304)
  142. # define BOOST_NO_CXX14_VARIABLE_TEMPLATES
  143. #endif
  144. // C++17
  145. #if !defined(__cpp_structured_bindings) || (__cpp_structured_bindings < 201606)
  146. # define BOOST_NO_CXX17_STRUCTURED_BINDINGS
  147. #endif
  148. #if !defined(__cpp_inline_variables) || (__cpp_inline_variables < 201606)
  149. # define BOOST_NO_CXX17_INLINE_VARIABLES
  150. #endif
  151. #if !defined(__cpp_fold_expressions) || (__cpp_fold_expressions < 201603)
  152. # define BOOST_NO_CXX17_FOLD_EXPRESSIONS
  153. #endif
  154. #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606)
  155. # define BOOST_NO_CXX17_IF_CONSTEXPR
  156. #endif
  157. //
  158. // TR1 macros:
  159. //
  160. #define BOOST_HAS_TR1_HASH
  161. #define BOOST_HAS_TR1_TYPE_TRAITS
  162. #define BOOST_HAS_TR1_UNORDERED_MAP
  163. #define BOOST_HAS_TR1_UNORDERED_SET
  164. #define BOOST_HAS_MACRO_USE_FACET
  165. #define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
  166. // On non-Win32 platforms let the platform config figure this out:
  167. #ifdef _WIN32
  168. # define BOOST_HAS_STDINT_H
  169. #endif
  170. //
  171. // __int64:
  172. //
  173. #if !defined(__STRICT_ANSI__)
  174. # define BOOST_HAS_MS_INT64
  175. #endif
  176. //
  177. // check for exception handling support:
  178. //
  179. #if !defined(_CPPUNWIND) && !defined(BOOST_CPPUNWIND) && !defined(__EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS)
  180. # define BOOST_NO_EXCEPTIONS
  181. #endif
  182. //
  183. // all versions have a <dirent.h>:
  184. //
  185. #if !defined(__STRICT_ANSI__)
  186. # define BOOST_HAS_DIRENT_H
  187. #endif
  188. //
  189. // all versions support __declspec:
  190. //
  191. #if defined(__STRICT_ANSI__)
  192. // config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
  193. # define BOOST_SYMBOL_EXPORT
  194. #endif
  195. //
  196. // ABI fixing headers:
  197. //
  198. #ifndef BOOST_ABI_PREFIX
  199. # define BOOST_ABI_PREFIX "boost/config/abi/borland_prefix.hpp"
  200. #endif
  201. #ifndef BOOST_ABI_SUFFIX
  202. # define BOOST_ABI_SUFFIX "boost/config/abi/borland_suffix.hpp"
  203. #endif
  204. //
  205. // Disable Win32 support in ANSI mode:
  206. //
  207. # pragma defineonoption BOOST_DISABLE_WIN32 -A
  208. //
  209. // MSVC compatibility mode does some nasty things:
  210. // TODO: look up if this doesn't apply to the whole 12xx range
  211. //
  212. #if defined(_MSC_VER) && (_MSC_VER <= 1200)
  213. # define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
  214. # define BOOST_NO_VOID_RETURNS
  215. #endif
  216. #define BOOST_COMPILER "CodeGear C++ version " BOOST_STRINGIZE(__CODEGEARC__)