intel.hpp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. // (C) Copyright John Maddock 2001-8.
  2. // (C) Copyright Peter Dimov 2001.
  3. // (C) Copyright Jens Maurer 2001.
  4. // (C) Copyright David Abrahams 2002 - 2003.
  5. // (C) Copyright Aleksey Gurtovoy 2002 - 2003.
  6. // (C) Copyright Guillaume Melquiond 2002 - 2003.
  7. // (C) Copyright Beman Dawes 2003.
  8. // (C) Copyright Martin Wille 2003.
  9. // Use, modification and distribution are subject to the
  10. // Boost Software License, Version 1.0. (See accompanying file
  11. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  12. // See http://www.boost.org for most recent version.
  13. // Intel compiler setup:
  14. #include "boost/config/compiler/common_edg.hpp"
  15. #if defined(__INTEL_COMPILER)
  16. # define BOOST_INTEL_CXX_VERSION __INTEL_COMPILER
  17. #elif defined(__ICL)
  18. # define BOOST_INTEL_CXX_VERSION __ICL
  19. #elif defined(__ICC)
  20. # define BOOST_INTEL_CXX_VERSION __ICC
  21. #elif defined(__ECC)
  22. # define BOOST_INTEL_CXX_VERSION __ECC
  23. #endif
  24. // Flags determined by comparing output of 'icpc -dM -E' with and without '-std=c++0x'
  25. #if (!(defined(_WIN32) || defined(_WIN64)) && defined(__STDC_HOSTED__) && (__STDC_HOSTED__ && (BOOST_INTEL_CXX_VERSION <= 1200))) || defined(__GXX_EXPERIMENTAL_CPP0X__) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  26. # define BOOST_INTEL_STDCXX0X
  27. #endif
  28. #if defined(_MSC_VER) && (_MSC_VER >= 1600)
  29. # define BOOST_INTEL_STDCXX0X
  30. #endif
  31. #ifdef BOOST_INTEL_STDCXX0X
  32. #define BOOST_COMPILER "Intel C++ C++0x mode version " BOOST_STRINGIZE(BOOST_INTEL_CXX_VERSION)
  33. #else
  34. #define BOOST_COMPILER "Intel C++ version " BOOST_STRINGIZE(BOOST_INTEL_CXX_VERSION)
  35. #endif
  36. #define BOOST_INTEL BOOST_INTEL_CXX_VERSION
  37. #if defined(_WIN32) || defined(_WIN64)
  38. # define BOOST_INTEL_WIN BOOST_INTEL
  39. #else
  40. # define BOOST_INTEL_LINUX BOOST_INTEL
  41. #endif
  42. #if (BOOST_INTEL_CXX_VERSION <= 600)
  43. # if defined(_MSC_VER) && (_MSC_VER <= 1300) // added check for <= VC 7 (Peter Dimov)
  44. // Boost libraries assume strong standard conformance unless otherwise
  45. // indicated by a config macro. As configured by Intel, the EDG front-end
  46. // requires certain compiler options be set to achieve that strong conformance.
  47. // Particularly /Qoption,c,--arg_dep_lookup (reported by Kirk Klobe & Thomas Witt)
  48. // and /Zc:wchar_t,forScope. See boost-root/tools/build/intel-win32-tools.jam for
  49. // details as they apply to particular versions of the compiler. When the
  50. // compiler does not predefine a macro indicating if an option has been set,
  51. // this config file simply assumes the option has been set.
  52. // Thus BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP will not be defined, even if
  53. // the compiler option is not enabled.
  54. # define BOOST_NO_SWPRINTF
  55. # endif
  56. // Void returns, 64 bit integrals don't work when emulating VC 6 (Peter Dimov)
  57. # if defined(_MSC_VER) && (_MSC_VER <= 1200)
  58. # define BOOST_NO_VOID_RETURNS
  59. # define BOOST_NO_INTEGRAL_INT64_T
  60. # endif
  61. #endif
  62. #if (BOOST_INTEL_CXX_VERSION <= 710) && defined(_WIN32)
  63. # define BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS
  64. #endif
  65. // See http://aspn.activestate.com/ASPN/Mail/Message/boost/1614864
  66. #if BOOST_INTEL_CXX_VERSION < 600
  67. # define BOOST_NO_INTRINSIC_WCHAR_T
  68. #else
  69. // We should test the macro _WCHAR_T_DEFINED to check if the compiler
  70. // supports wchar_t natively. *BUT* there is a problem here: the standard
  71. // headers define this macro if they typedef wchar_t. Anyway, we're lucky
  72. // because they define it without a value, while Intel C++ defines it
  73. // to 1. So we can check its value to see if the macro was defined natively
  74. // or not.
  75. // Under UNIX, the situation is exactly the same, but the macro _WCHAR_T
  76. // is used instead.
  77. # if ((_WCHAR_T_DEFINED + 0) == 0) && ((_WCHAR_T + 0) == 0)
  78. # define BOOST_NO_INTRINSIC_WCHAR_T
  79. # endif
  80. #endif
  81. #if defined(__GNUC__) && !defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL)
  82. //
  83. // Figure out when Intel is emulating this gcc bug
  84. // (All Intel versions prior to 9.0.26, and versions
  85. // later than that if they are set up to emulate gcc 3.2
  86. // or earlier):
  87. //
  88. # if ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)) || (BOOST_INTEL < 900) || (__INTEL_COMPILER_BUILD_DATE < 20050912)
  89. # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
  90. # endif
  91. #endif
  92. #if (defined(__GNUC__) && (__GNUC__ < 4)) || (defined(_WIN32) && (BOOST_INTEL_CXX_VERSION <= 1200)) || (BOOST_INTEL_CXX_VERSION <= 1200)
  93. // GCC or VC emulation:
  94. #define BOOST_NO_TWO_PHASE_NAME_LOOKUP
  95. #endif
  96. //
  97. // Verify that we have actually got BOOST_NO_INTRINSIC_WCHAR_T
  98. // set correctly, if we don't do this now, we will get errors later
  99. // in type_traits code among other things, getting this correct
  100. // for the Intel compiler is actually remarkably fragile and tricky:
  101. //
  102. #ifdef __cplusplus
  103. #if defined(BOOST_NO_INTRINSIC_WCHAR_T)
  104. #include <cwchar>
  105. template< typename T > struct assert_no_intrinsic_wchar_t;
  106. template<> struct assert_no_intrinsic_wchar_t<wchar_t> { typedef void type; };
  107. // if you see an error here then you need to unset BOOST_NO_INTRINSIC_WCHAR_T
  108. // where it is defined above:
  109. typedef assert_no_intrinsic_wchar_t<unsigned short>::type assert_no_intrinsic_wchar_t_;
  110. #else
  111. template< typename T > struct assert_intrinsic_wchar_t;
  112. template<> struct assert_intrinsic_wchar_t<wchar_t> {};
  113. // if you see an error here then define BOOST_NO_INTRINSIC_WCHAR_T on the command line:
  114. template<> struct assert_intrinsic_wchar_t<unsigned short> {};
  115. #endif
  116. #endif
  117. #if defined(_MSC_VER) && (_MSC_VER+0 >= 1000)
  118. # if _MSC_VER >= 1200
  119. # define BOOST_HAS_MS_INT64
  120. # endif
  121. # define BOOST_NO_SWPRINTF
  122. # define BOOST_NO_TWO_PHASE_NAME_LOOKUP
  123. #elif defined(_WIN32)
  124. # define BOOST_DISABLE_WIN32
  125. #endif
  126. // I checked version 6.0 build 020312Z, it implements the NRVO.
  127. // Correct this as you find out which version of the compiler
  128. // implemented the NRVO first. (Daniel Frey)
  129. #if (BOOST_INTEL_CXX_VERSION >= 600)
  130. # define BOOST_HAS_NRVO
  131. #endif
  132. // Branch prediction hints
  133. // I'm not sure 8.0 was the first version to support these builtins,
  134. // update the condition if the version is not accurate. (Andrey Semashev)
  135. #if defined(__GNUC__) && BOOST_INTEL_CXX_VERSION >= 800
  136. #define BOOST_LIKELY(x) __builtin_expect(x, 1)
  137. #define BOOST_UNLIKELY(x) __builtin_expect(x, 0)
  138. #endif
  139. //
  140. // versions check:
  141. // we don't support Intel prior to version 6.0:
  142. #if BOOST_INTEL_CXX_VERSION < 600
  143. # error "Compiler not supported or configured - please reconfigure"
  144. #endif
  145. // Intel on MacOS requires
  146. #if defined(__APPLE__) && defined(__INTEL_COMPILER)
  147. # define BOOST_NO_TWO_PHASE_NAME_LOOKUP
  148. #endif
  149. // Intel on Altix Itanium
  150. #if defined(__itanium__) && defined(__INTEL_COMPILER)
  151. # define BOOST_NO_TWO_PHASE_NAME_LOOKUP
  152. #endif
  153. //
  154. // An attempt to value-initialize a pointer-to-member may trigger an
  155. // internal error on Intel <= 11.1 (last checked version), as was
  156. // reported by John Maddock, Intel support issue 589832, May 2010.
  157. // Moreover, according to test results from Huang-Vista-x86_32_intel,
  158. // intel-vc9-win-11.1 may leave a non-POD array uninitialized, in some
  159. // cases when it should be value-initialized.
  160. // (Niels Dekker, LKEB, May 2010)
  161. // Apparently Intel 12.1 (compiler version number 9999 !!) has the same issue (compiler regression).
  162. #if defined(__INTEL_COMPILER)
  163. # if (__INTEL_COMPILER <= 1110) || (__INTEL_COMPILER == 9999) || (defined(_WIN32) && (__INTEL_COMPILER < 1500))
  164. # define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
  165. # endif
  166. #endif
  167. //
  168. // Dynamic shared object (DSO) and dynamic-link library (DLL) support
  169. //
  170. #if defined(__GNUC__) && (__GNUC__ >= 4)
  171. # define BOOST_SYMBOL_EXPORT __attribute__((visibility("default")))
  172. # define BOOST_SYMBOL_IMPORT
  173. # define BOOST_SYMBOL_VISIBLE __attribute__((visibility("default")))
  174. #endif
  175. //
  176. // C++0x features
  177. // - ICC added static_assert in 11.0 (first version with C++0x support)
  178. //
  179. #if defined(BOOST_INTEL_STDCXX0X)
  180. # undef BOOST_NO_CXX11_STATIC_ASSERT
  181. //
  182. // These pass our test cases, but aren't officially supported according to:
  183. // http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler/
  184. //
  185. //# undef BOOST_NO_CXX11_LAMBDAS
  186. //# undef BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
  187. //# undef BOOST_NO_CXX11_DECLTYPE
  188. //# undef BOOST_NO_CXX11_AUTO_DECLARATIONS
  189. //# undef BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
  190. #endif
  191. #if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION >= 1200)
  192. //# undef BOOST_NO_CXX11_RVALUE_REFERENCES // Enabling this breaks Filesystem and Exception libraries
  193. //# undef BOOST_NO_CXX11_SCOPED_ENUMS // doesn't really work!!
  194. # undef BOOST_NO_CXX11_DELETED_FUNCTIONS
  195. # undef BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
  196. # undef BOOST_NO_CXX11_LAMBDAS
  197. # undef BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
  198. # undef BOOST_NO_CXX11_DECLTYPE
  199. # undef BOOST_NO_CXX11_AUTO_DECLARATIONS
  200. # undef BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
  201. # undef BOOST_NO_CXX11_TRAILING_RESULT_TYPES
  202. #endif
  203. // icl Version 12.1.0.233 Build 20110811 and possibly some other builds
  204. // had an incorrect __INTEL_COMPILER value of 9999. Intel say this has been fixed.
  205. #if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION > 1200)
  206. # undef BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
  207. # undef BOOST_NO_CXX11_NULLPTR
  208. # undef BOOST_NO_CXX11_RVALUE_REFERENCES
  209. # undef BOOST_NO_SFINAE_EXPR
  210. # undef BOOST_NO_CXX11_TEMPLATE_ALIASES
  211. # undef BOOST_NO_CXX11_VARIADIC_TEMPLATES
  212. // http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler/
  213. // continues to list scoped enum support as "Partial"
  214. //# undef BOOST_NO_CXX11_SCOPED_ENUMS
  215. #endif
  216. #if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION >= 1310) && !defined(_MSC_VER)
  217. # undef BOOST_NO_CXX11_INLINE_NAMESPACES
  218. # undef BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
  219. // This one generates internal compiler errors in multiprecision, disabled for now:
  220. //# undef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
  221. // This one generates errors when used with conditional exception specifications, for example in multiprecision:
  222. //# undef BOOST_NO_CXX11_NOEXCEPT
  223. # undef BOOST_NO_CXX11_RANGE_BASED_FOR
  224. # undef BOOST_NO_CXX11_SCOPED_ENUMS
  225. # undef BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
  226. #endif
  227. #if (BOOST_INTEL_CXX_VERSION >= 1310)
  228. # undef BOOST_NO_SFINAE_EXPR
  229. #endif
  230. #if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION >= 1400) && !defined(_MSC_VER)
  231. # undef BOOST_NO_CXX11_UNICODE_LITERALS
  232. # undef BOOST_NO_CXX11_RAW_LITERALS
  233. // This one generates errors when used with conditional exception specifications, for example in multiprecision:
  234. //# undef BOOST_NO_CXX11_NOEXCEPT
  235. // This breaks multiprecision:
  236. //# undef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
  237. # undef BOOST_NO_CXX11_HDR_THREAD
  238. # undef BOOST_NO_CXX11_CHAR32_T
  239. # undef BOOST_NO_CXX11_CHAR16_T
  240. #endif
  241. #if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION <= 1310)
  242. # define BOOST_NO_CXX11_HDR_FUTURE
  243. # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
  244. #endif
  245. #if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION == 1400)
  246. // A regression in Intel's compiler means that <tuple> seems to be broken in this release as well as <future> :
  247. # define BOOST_NO_CXX11_HDR_FUTURE
  248. # define BOOST_NO_CXX11_HDR_TUPLE
  249. #endif
  250. #if defined(_MSC_VER) && (_MSC_VER <= 1700)
  251. //
  252. // Although the Intel compiler is capable of supporting these, it appears not to in MSVC compatibility mode:
  253. //
  254. # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
  255. # define BOOST_NO_CXX11_VARIADIC_TEMPLATES
  256. # define BOOST_NO_CXX11_DELETED_FUNCTIONS
  257. # define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
  258. # define BOOST_NO_CXX11_TEMPLATE_ALIASES
  259. # if(BOOST_INTEL_CXX_VERSION < 1310)
  260. # define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
  261. # endif
  262. #endif
  263. #if (BOOST_INTEL_CXX_VERSION < 1200)
  264. //
  265. // fenv.h appears not to work with Intel prior to 12.0:
  266. //
  267. # define BOOST_NO_FENV_H
  268. #endif
  269. #if defined(_MSC_VER) && (_MSC_VER >= 1600)
  270. # define BOOST_HAS_STDINT_H
  271. #endif
  272. #if defined(__LP64__) && defined(__GNUC__) && (BOOST_INTEL_CXX_VERSION >= 1310)
  273. # define BOOST_HAS_INT128
  274. #endif
  275. //
  276. // last known and checked version:
  277. #if (BOOST_INTEL_CXX_VERSION > 1310)
  278. # if defined(BOOST_ASSERT_CONFIG)
  279. # error "Unknown compiler version - please run the configure tests and report the results"
  280. # elif defined(_MSC_VER)
  281. //
  282. // We don't emit this warning any more, since we have so few
  283. // defect macros set anyway (just the one).
  284. //
  285. //# pragma message("Unknown compiler version - please run the configure tests and report the results")
  286. # endif
  287. #endif