codegear.hpp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  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. //
  10. // versions check:
  11. // last known and checked version is 0x740
  12. #if (__CODEGEARC__ > 0x740)
  13. # if defined(BOOST_ASSERT_CONFIG)
  14. # error "boost: Unknown compiler version - please run the configure tests and report the results"
  15. # else
  16. # pragma message( "boost: Unknown compiler version - please run the configure tests and report the results")
  17. # endif
  18. #endif
  19. #ifdef __clang__ // Clang enhanced Windows compiler
  20. # include "clang.hpp"
  21. # define BOOST_NO_CXX11_THREAD_LOCAL
  22. # define BOOST_NO_CXX11_ATOMIC_SMART_PTR
  23. // This bug has been reported to Embarcadero
  24. #if defined(BOOST_HAS_INT128)
  25. #undef BOOST_HAS_INT128
  26. #endif
  27. #if defined(BOOST_HAS_FLOAT128)
  28. #undef BOOST_HAS_FLOAT128
  29. #endif
  30. // The clang-based compilers can not do 128 atomic exchanges
  31. #define BOOST_ATOMIC_NO_CMPXCHG16B
  32. // 32 functions are missing from the current RTL in cwchar, so it really can not be used even if it exists
  33. # define BOOST_NO_CWCHAR
  34. # ifndef __MT__ /* If compiling in single-threaded mode, assume there is no CXX11_HDR_ATOMIC */
  35. # define BOOST_NO_CXX11_HDR_ATOMIC
  36. # endif
  37. /* temporarily disable this until we can link against fegetround fesetround feholdexcept */
  38. #define BOOST_NO_FENV_H
  39. /* Reported this bug to Embarcadero with the latest C++ Builder Rio release */
  40. #define BOOST_NO_CXX11_HDR_EXCEPTION
  41. //
  42. // check for exception handling support:
  43. //
  44. #if !defined(_CPPUNWIND) && !defined(__EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS)
  45. # define BOOST_NO_EXCEPTIONS
  46. #endif
  47. /*
  48. // On non-Win32 platforms let the platform config figure this out:
  49. #ifdef _WIN32
  50. # define BOOST_HAS_STDINT_H
  51. #endif
  52. //
  53. // __int64:
  54. //
  55. #if !defined(__STRICT_ANSI__)
  56. # define BOOST_HAS_MS_INT64
  57. #endif
  58. //
  59. // all versions have a <dirent.h>:
  60. //
  61. #if !defined(__STRICT_ANSI__)
  62. # define BOOST_HAS_DIRENT_H
  63. #endif
  64. //
  65. // Disable Win32 support in ANSI mode:
  66. //
  67. # pragma defineonoption BOOST_DISABLE_WIN32 -A
  68. //
  69. // MSVC compatibility mode does some nasty things:
  70. // TODO: look up if this doesn't apply to the whole 12xx range
  71. //
  72. #if defined(_MSC_VER) && (_MSC_VER <= 1200)
  73. # define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
  74. # define BOOST_NO_VOID_RETURNS
  75. #endif
  76. //
  77. */
  78. // Specific settings for Embarcadero drivers
  79. # define BOOST_EMBTC __CODEGEARC__
  80. # define BOOST_EMBTC_FULL_VER ((__clang_major__ << 16) | \
  81. (__clang_minor__ << 8) | \
  82. __clang_patchlevel__ )
  83. // Detecting which Embarcadero driver is being used
  84. #if defined(BOOST_EMBTC)
  85. # if defined(_WIN64)
  86. # define BOOST_EMBTC_WIN64 1
  87. # define BOOST_EMBTC_WINDOWS 1
  88. # ifndef BOOST_USE_WINDOWS_H
  89. # define BOOST_USE_WINDOWS_H
  90. # endif
  91. # elif defined(_WIN32)
  92. # define BOOST_EMBTC_WIN32C 1
  93. # define BOOST_EMBTC_WINDOWS 1
  94. # ifndef BOOST_USE_WINDOWS_H
  95. # define BOOST_USE_WINDOWS_H
  96. # endif
  97. # elif defined(__APPLE__) && defined(__arm__)
  98. # define BOOST_EMBTC_IOSARM 1
  99. # define BOOST_EMBTC_IOS 1
  100. # elif defined(__APPLE__) && defined(__aarch64__)
  101. # define BOOST_EMBTC_IOSARM64 1
  102. # define BOOST_EMBTC_IOS 1
  103. # elif defined(__ANDROID__) && defined(__arm__)
  104. # define BOOST_EMBTC_AARM 1
  105. # define BOOST_EMBTC_ANDROID 1
  106. # elif
  107. # if defined(BOOST_ASSERT_CONFIG)
  108. # error "Unknown Embarcadero driver"
  109. # else
  110. # warning "Unknown Embarcadero driver"
  111. # endif /* defined(BOOST_ASSERT_CONFIG) */
  112. # endif
  113. #endif /* defined(BOOST_EMBTC) */
  114. #if defined(BOOST_EMBTC_WINDOWS)
  115. #if !defined(_chdir)
  116. #define _chdir(x) chdir(x)
  117. #endif
  118. #if !defined(_dup2)
  119. #define _dup2(x,y) dup2(x,y)
  120. #endif
  121. #endif
  122. # undef BOOST_COMPILER
  123. # define BOOST_COMPILER "Embarcadero-Clang C++ version " BOOST_STRINGIZE(__CODEGEARC__) " clang: " __clang_version__
  124. // # define __CODEGEARC_CLANG__ __CODEGEARC__
  125. // # define __EMBARCADERO_CLANG__ __CODEGEARC__
  126. // # define __BORLANDC_CLANG__ __BORLANDC__
  127. #else // #if !defined(__clang__)
  128. # define BOOST_CODEGEARC __CODEGEARC__
  129. # define BOOST_BORLANDC __BORLANDC__
  130. #if !defined( BOOST_WITH_CODEGEAR_WARNINGS )
  131. // these warnings occur frequently in optimized template code
  132. # pragma warn -8004 // var assigned value, but never used
  133. # pragma warn -8008 // condition always true/false
  134. # pragma warn -8066 // dead code can never execute
  135. # pragma warn -8104 // static members with ctors not threadsafe
  136. # pragma warn -8105 // reference member in class without ctors
  137. #endif
  138. // CodeGear C++ Builder 2009
  139. #if (__CODEGEARC__ <= 0x613)
  140. # define BOOST_NO_INTEGRAL_INT64_T
  141. # define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
  142. # define BOOST_NO_PRIVATE_IN_AGGREGATE
  143. # define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
  144. // we shouldn't really need this - but too many things choke
  145. // without it, this needs more investigation:
  146. # define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
  147. # define BOOST_SP_NO_SP_CONVERTIBLE
  148. #endif
  149. // CodeGear C++ Builder 2010
  150. #if (__CODEGEARC__ <= 0x621)
  151. # define BOOST_NO_TYPENAME_WITH_CTOR // Cannot use typename keyword when making temporaries of a dependant type
  152. # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
  153. # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
  154. # define BOOST_NO_NESTED_FRIENDSHIP // TC1 gives nested classes access rights as any other member
  155. # define BOOST_NO_USING_TEMPLATE
  156. # define BOOST_NO_TWO_PHASE_NAME_LOOKUP
  157. // Temporary hack, until specific MPL preprocessed headers are generated
  158. # define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
  159. // CodeGear has not yet completely implemented value-initialization, for
  160. // example for array types, as I reported in 2010: Embarcadero Report 83751,
  161. // "Value-initialization: arrays should have each element value-initialized",
  162. // http://qc.embarcadero.com/wc/qcmain.aspx?d=83751
  163. // Last checked version: Embarcadero C++ 6.21
  164. // See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
  165. // (Niels Dekker, LKEB, April 2010)
  166. # define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
  167. # if defined(NDEBUG) && defined(__cplusplus)
  168. // fix broken <cstring> so that Boost.test works:
  169. # include <cstring>
  170. # undef strcmp
  171. # endif
  172. // fix broken errno declaration:
  173. # include <errno.h>
  174. # ifndef errno
  175. # define errno errno
  176. # endif
  177. #endif
  178. // Reportedly, #pragma once is supported since C++ Builder 2010
  179. #if (__CODEGEARC__ >= 0x620)
  180. # define BOOST_HAS_PRAGMA_ONCE
  181. #endif
  182. #define BOOST_NO_FENV_H
  183. //
  184. // C++0x macros:
  185. //
  186. #if (__CODEGEARC__ <= 0x620)
  187. #define BOOST_NO_CXX11_STATIC_ASSERT
  188. #else
  189. #define BOOST_HAS_STATIC_ASSERT
  190. #endif
  191. #define BOOST_HAS_CHAR16_T
  192. #define BOOST_HAS_CHAR32_T
  193. #define BOOST_HAS_LONG_LONG
  194. // #define BOOST_HAS_ALIGNOF
  195. #define BOOST_HAS_DECLTYPE
  196. #define BOOST_HAS_EXPLICIT_CONVERSION_OPS
  197. // #define BOOST_HAS_RVALUE_REFS
  198. #define BOOST_HAS_SCOPED_ENUM
  199. // #define BOOST_HAS_STATIC_ASSERT
  200. #define BOOST_HAS_STD_TYPE_TRAITS
  201. #define BOOST_NO_CXX11_AUTO_DECLARATIONS
  202. #define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
  203. #define BOOST_NO_CXX11_CONSTEXPR
  204. #define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
  205. #define BOOST_NO_CXX11_DELETED_FUNCTIONS
  206. #define BOOST_NO_CXX11_EXTERN_TEMPLATE
  207. #define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
  208. #define BOOST_NO_CXX11_LAMBDAS
  209. #define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
  210. #define BOOST_NO_CXX11_NOEXCEPT
  211. #define BOOST_NO_CXX11_NULLPTR
  212. #define BOOST_NO_CXX11_RANGE_BASED_FOR
  213. #define BOOST_NO_CXX11_RAW_LITERALS
  214. #define BOOST_NO_CXX11_RVALUE_REFERENCES
  215. #define BOOST_NO_SFINAE_EXPR
  216. #define BOOST_NO_CXX11_SFINAE_EXPR
  217. #define BOOST_NO_CXX11_TEMPLATE_ALIASES
  218. #define BOOST_NO_CXX11_UNICODE_LITERALS
  219. #define BOOST_NO_CXX11_VARIADIC_TEMPLATES
  220. #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
  221. #define BOOST_NO_CXX11_USER_DEFINED_LITERALS
  222. #define BOOST_NO_CXX11_ALIGNAS
  223. #define BOOST_NO_CXX11_ALIGNOF
  224. #define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
  225. #define BOOST_NO_CXX11_INLINE_NAMESPACES
  226. #define BOOST_NO_CXX11_REF_QUALIFIERS
  227. #define BOOST_NO_CXX11_FINAL
  228. #define BOOST_NO_CXX11_OVERRIDE
  229. #define BOOST_NO_CXX11_THREAD_LOCAL
  230. #define BOOST_NO_CXX11_DECLTYPE_N3276
  231. #define BOOST_NO_CXX11_UNRESTRICTED_UNION
  232. // C++ 14:
  233. #if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)
  234. # define BOOST_NO_CXX14_AGGREGATE_NSDMI
  235. #endif
  236. #if !defined(__cpp_binary_literals) || (__cpp_binary_literals < 201304)
  237. # define BOOST_NO_CXX14_BINARY_LITERALS
  238. #endif
  239. #if !defined(__cpp_constexpr) || (__cpp_constexpr < 201304)
  240. # define BOOST_NO_CXX14_CONSTEXPR
  241. #endif
  242. #if !defined(__cpp_decltype_auto) || (__cpp_decltype_auto < 201304)
  243. # define BOOST_NO_CXX14_DECLTYPE_AUTO
  244. #endif
  245. #if (__cplusplus < 201304) // There's no SD6 check for this....
  246. # define BOOST_NO_CXX14_DIGIT_SEPARATORS
  247. #endif
  248. #if !defined(__cpp_generic_lambdas) || (__cpp_generic_lambdas < 201304)
  249. # define BOOST_NO_CXX14_GENERIC_LAMBDAS
  250. #endif
  251. #if !defined(__cpp_init_captures) || (__cpp_init_captures < 201304)
  252. # define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
  253. #endif
  254. #if !defined(__cpp_return_type_deduction) || (__cpp_return_type_deduction < 201304)
  255. # define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
  256. #endif
  257. #if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304)
  258. # define BOOST_NO_CXX14_VARIABLE_TEMPLATES
  259. #endif
  260. // C++17
  261. #if !defined(__cpp_structured_bindings) || (__cpp_structured_bindings < 201606)
  262. # define BOOST_NO_CXX17_STRUCTURED_BINDINGS
  263. #endif
  264. #if !defined(__cpp_inline_variables) || (__cpp_inline_variables < 201606)
  265. # define BOOST_NO_CXX17_INLINE_VARIABLES
  266. #endif
  267. #if !defined(__cpp_fold_expressions) || (__cpp_fold_expressions < 201603)
  268. # define BOOST_NO_CXX17_FOLD_EXPRESSIONS
  269. #endif
  270. #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606)
  271. # define BOOST_NO_CXX17_IF_CONSTEXPR
  272. #endif
  273. #if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606)
  274. # define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS
  275. #endif
  276. //
  277. // TR1 macros:
  278. //
  279. #define BOOST_HAS_TR1_HASH
  280. #define BOOST_HAS_TR1_TYPE_TRAITS
  281. #define BOOST_HAS_TR1_UNORDERED_MAP
  282. #define BOOST_HAS_TR1_UNORDERED_SET
  283. #define BOOST_HAS_MACRO_USE_FACET
  284. #define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
  285. // On non-Win32 platforms let the platform config figure this out:
  286. #ifdef _WIN32
  287. # define BOOST_HAS_STDINT_H
  288. #endif
  289. //
  290. // __int64:
  291. //
  292. #if !defined(__STRICT_ANSI__)
  293. # define BOOST_HAS_MS_INT64
  294. #endif
  295. //
  296. // check for exception handling support:
  297. //
  298. #if !defined(_CPPUNWIND) && !defined(BOOST_CPPUNWIND) && !defined(__EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS)
  299. # define BOOST_NO_EXCEPTIONS
  300. #endif
  301. //
  302. // all versions have a <dirent.h>:
  303. //
  304. #if !defined(__STRICT_ANSI__)
  305. # define BOOST_HAS_DIRENT_H
  306. #endif
  307. //
  308. // all versions support __declspec:
  309. //
  310. #if defined(__STRICT_ANSI__)
  311. // config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
  312. # define BOOST_SYMBOL_EXPORT
  313. #endif
  314. //
  315. // ABI fixing headers:
  316. //
  317. #ifndef BOOST_ABI_PREFIX
  318. # define BOOST_ABI_PREFIX "boost/config/abi/borland_prefix.hpp"
  319. #endif
  320. #ifndef BOOST_ABI_SUFFIX
  321. # define BOOST_ABI_SUFFIX "boost/config/abi/borland_suffix.hpp"
  322. #endif
  323. //
  324. // Disable Win32 support in ANSI mode:
  325. //
  326. # pragma defineonoption BOOST_DISABLE_WIN32 -A
  327. //
  328. // MSVC compatibility mode does some nasty things:
  329. // TODO: look up if this doesn't apply to the whole 12xx range
  330. //
  331. #if defined(_MSC_VER) && (_MSC_VER <= 1200)
  332. # define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
  333. # define BOOST_NO_VOID_RETURNS
  334. #endif
  335. #define BOOST_COMPILER "CodeGear C++ version " BOOST_STRINGIZE(__CODEGEARC__)
  336. #endif // #if !defined(__clang__)