borland.hpp 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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. // Borland C++ compiler setup:
  9. //
  10. // versions check:
  11. // we don't support Borland prior to version 5.4:
  12. #if __BORLANDC__ < 0x540
  13. # error "Compiler not supported or configured - please reconfigure"
  14. #endif
  15. // last known compiler version:
  16. #if (__BORLANDC__ > 0x610)
  17. //# if defined(BOOST_ASSERT_CONFIG)
  18. # error "Unknown compiler version - please run the configure tests and report the results"
  19. //# else
  20. //# pragma message( "Unknown compiler version - please run the configure tests and report the results")
  21. //# endif
  22. #elif (__BORLANDC__ == 0x600)
  23. # error "CBuilderX preview compiler is no longer supported"
  24. #endif
  25. //
  26. // Support macros to help with standard library detection
  27. #if (__BORLANDC__ < 0x560) || defined(_USE_OLD_RW_STL)
  28. # define BOOST_BCB_WITH_ROGUE_WAVE
  29. #elif __BORLANDC__ < 0x570
  30. # define BOOST_BCB_WITH_STLPORT
  31. #else
  32. # define BOOST_BCB_WITH_DINKUMWARE
  33. #endif
  34. //
  35. // Version 5.0 and below:
  36. # if __BORLANDC__ <= 0x0550
  37. // Borland C++Builder 4 and 5:
  38. # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
  39. # if __BORLANDC__ == 0x0550
  40. // Borland C++Builder 5, command-line compiler 5.5:
  41. # define BOOST_NO_OPERATORS_IN_NAMESPACE
  42. # endif
  43. # endif
  44. // Version 5.51 and below:
  45. #if (__BORLANDC__ <= 0x551)
  46. # define BOOST_NO_CV_SPECIALIZATIONS
  47. # define BOOST_NO_CV_VOID_SPECIALIZATIONS
  48. # define BOOST_NO_DEDUCED_TYPENAME
  49. // workaround for missing WCHAR_MAX/WCHAR_MIN:
  50. #include <climits>
  51. #include <cwchar>
  52. #ifndef WCHAR_MAX
  53. # define WCHAR_MAX 0xffff
  54. #endif
  55. #ifndef WCHAR_MIN
  56. # define WCHAR_MIN 0
  57. #endif
  58. #endif
  59. // Borland C++ Builder 6 and below:
  60. #if (__BORLANDC__ <= 0x564)
  61. # define BOOST_NO_INTEGRAL_INT64_T
  62. # ifdef NDEBUG
  63. // fix broken <cstring> so that Boost.test works:
  64. # include <cstring>
  65. # undef strcmp
  66. # endif
  67. // fix broken errno declaration:
  68. # include <errno.h>
  69. # ifndef errno
  70. # define errno errno
  71. # endif
  72. #endif
  73. //
  74. // new bug in 5.61:
  75. #if (__BORLANDC__ >= 0x561) && (__BORLANDC__ <= 0x580)
  76. // this seems to be needed by the command line compiler, but not the IDE:
  77. # define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS
  78. #endif
  79. // Borland C++ Builder 2006 Update 2 and below:
  80. #if (__BORLANDC__ <= 0x582)
  81. # define BOOST_NO_SFINAE
  82. # define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG
  83. # define BOOST_NO_TEMPLATE_TEMPLATES
  84. # define BOOST_NO_PRIVATE_IN_AGGREGATE
  85. # ifdef _WIN32
  86. # define BOOST_NO_SWPRINTF
  87. # elif defined(linux) || defined(__linux__) || defined(__linux)
  88. // we should really be able to do without this
  89. // but the wcs* functions aren't imported into std::
  90. # define BOOST_NO_STDC_NAMESPACE
  91. // _CPPUNWIND doesn't get automatically set for some reason:
  92. # pragma defineonoption BOOST_CPPUNWIND -x
  93. # endif
  94. #endif
  95. // Borland C++ Builder 2007 December 2007 Update and below:
  96. //#if (__BORLANDC__ <= 0x593)
  97. #if (__BORLANDC__ <= 0x610) // Beman has asked Alisdair for more info
  98. // we shouldn't really need this - but too many things choke
  99. // without it, this needs more investigation:
  100. # define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
  101. # define BOOST_NO_IS_ABSTRACT
  102. # define BOOST_NO_FUNCTION_TYPE_SPECIALIZATIONS
  103. // Temporary workaround
  104. #define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
  105. #endif
  106. // Borland C++ Builder 2008 and below:
  107. #if (__BORLANDC__ <= 0x601)
  108. # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
  109. # define BOOST_ILLEGAL_CV_REFERENCES
  110. # define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
  111. # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
  112. # define BOOST_NO_TWO_PHASE_NAME_LOOKUP
  113. # define BOOST_NO_USING_TEMPLATE
  114. # define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
  115. # define BOOST_NO_NESTED_FRIENDSHIP
  116. # define BOOST_NO_TYPENAME_WITH_CTOR
  117. #endif
  118. //
  119. // Positive Feature detection
  120. //
  121. // Borland C++ Builder 2008 and below:
  122. #if (__BORLANDC__ >= 0x599)
  123. # pragma defineonoption BOOST_CODEGEAR_0X_SUPPORT -Ax
  124. #endif
  125. //
  126. // C++0x Macros:
  127. //
  128. #if !defined( BOOST_CODEGEAR_0X_SUPPORT ) || (__BORLANDC__ < 0x610)
  129. # define BOOST_NO_CHAR16_T
  130. # define BOOST_NO_CHAR32_T
  131. # define BOOST_NO_DECLTYPE
  132. # define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
  133. # define BOOST_NO_EXTERN_TEMPLATE
  134. # define BOOST_NO_RVALUE_REFERENCES
  135. # define BOOST_NO_SCOPED_ENUMS
  136. # define BOOST_NO_STATIC_ASSERT
  137. #else
  138. # define BOOST_HAS_ALIGNOF
  139. # define BOOST_HAS_CHAR16_T
  140. # define BOOST_HAS_CHAR32_T
  141. # define BOOST_HAS_DECLTYPE
  142. # define BOOST_HAS_EXPLICIT_CONVERSION_OPS
  143. # define BOOST_HAS_REF_QUALIFIER
  144. # define BOOST_HAS_RVALUE_REFS
  145. # define BOOST_HAS_STATIC_ASSERT
  146. #endif
  147. #define BOOST_NO_AUTO_DECLARATIONS
  148. #define BOOST_NO_AUTO_MULTIDECLARATIONS
  149. #define BOOST_NO_CONCEPTS
  150. #define BOOST_NO_CONSTEXPR
  151. #define BOOST_NO_DEFAULTED_FUNCTIONS
  152. #define BOOST_NO_DELETED_FUNCTIONS
  153. #define BOOST_NO_INITIALIZER_LISTS
  154. #define BOOST_NO_LAMBDAS
  155. #define BOOST_NO_NULLPTR
  156. #define BOOST_NO_RAW_LITERALS
  157. #define BOOST_NO_RVALUE_REFERENCES
  158. #define BOOST_NO_SCOPED_ENUMS
  159. #define BOOST_NO_TEMPLATE_ALIASES
  160. #define BOOST_NO_UNICODE_LITERALS // UTF-8 still not supported
  161. #define BOOST_NO_VARIADIC_TEMPLATES
  162. #if __BORLANDC__ >= 0x590
  163. # define BOOST_HAS_TR1_HASH
  164. # define BOOST_HAS_MACRO_USE_FACET
  165. #endif
  166. //
  167. // Post 0x561 we have long long and stdint.h:
  168. #if __BORLANDC__ >= 0x561
  169. # ifndef __NO_LONG_LONG
  170. # define BOOST_HAS_LONG_LONG
  171. # else
  172. # define BOOST_NO_LONG_LONG
  173. # endif
  174. // On non-Win32 platforms let the platform config figure this out:
  175. # ifdef _WIN32
  176. # define BOOST_HAS_STDINT_H
  177. # endif
  178. #endif
  179. // Borland C++Builder 6 defaults to using STLPort. If _USE_OLD_RW_STL is
  180. // defined, then we have 0x560 or greater with the Rogue Wave implementation
  181. // which presumably has the std::DBL_MAX bug.
  182. #if defined( BOOST_BCB_WITH_ROGUE_WAVE )
  183. // <climits> is partly broken, some macros define symbols that are really in
  184. // namespace std, so you end up having to use illegal constructs like
  185. // std::DBL_MAX, as a fix we'll just include float.h and have done with:
  186. #include <float.h>
  187. #endif
  188. //
  189. // __int64:
  190. //
  191. #if (__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__)
  192. # define BOOST_HAS_MS_INT64
  193. #endif
  194. //
  195. // check for exception handling support:
  196. //
  197. #if !defined(_CPPUNWIND) && !defined(BOOST_CPPUNWIND) && !defined(__EXCEPTIONS)
  198. # define BOOST_NO_EXCEPTIONS
  199. #endif
  200. //
  201. // all versions have a <dirent.h>:
  202. //
  203. #ifndef __STRICT_ANSI__
  204. # define BOOST_HAS_DIRENT_H
  205. #endif
  206. //
  207. // all versions support __declspec:
  208. //
  209. #ifndef __STRICT_ANSI__
  210. # define BOOST_HAS_DECLSPEC
  211. #endif
  212. //
  213. // ABI fixing headers:
  214. //
  215. #if __BORLANDC__ < 0x600 // not implemented for version 6 compiler yet
  216. #ifndef BOOST_ABI_PREFIX
  217. # define BOOST_ABI_PREFIX "boost/config/abi/borland_prefix.hpp"
  218. #endif
  219. #ifndef BOOST_ABI_SUFFIX
  220. # define BOOST_ABI_SUFFIX "boost/config/abi/borland_suffix.hpp"
  221. #endif
  222. #endif
  223. //
  224. // Disable Win32 support in ANSI mode:
  225. //
  226. #if __BORLANDC__ < 0x600
  227. # pragma defineonoption BOOST_DISABLE_WIN32 -A
  228. #elif defined(__STRICT_ANSI__)
  229. # define BOOST_DISABLE_WIN32
  230. #endif
  231. //
  232. // MSVC compatibility mode does some nasty things:
  233. // TODO: look up if this doesn't apply to the whole 12xx range
  234. //
  235. #if defined(_MSC_VER) && (_MSC_VER <= 1200)
  236. # define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
  237. # define BOOST_NO_VOID_RETURNS
  238. #endif
  239. #define BOOST_COMPILER "Borland C++ version " BOOST_STRINGIZE(__BORLANDC__)