intel.hpp 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. #define BOOST_COMPILER "Intel C++ version " BOOST_STRINGIZE(BOOST_INTEL_CXX_VERSION)
  25. #define BOOST_INTEL BOOST_INTEL_CXX_VERSION
  26. #if defined(_WIN32) || defined(_WIN64)
  27. # define BOOST_INTEL_WIN BOOST_INTEL
  28. #else
  29. # define BOOST_INTEL_LINUX BOOST_INTEL
  30. #endif
  31. #if (BOOST_INTEL_CXX_VERSION <= 500) && defined(_MSC_VER)
  32. # define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
  33. # define BOOST_NO_TEMPLATE_TEMPLATES
  34. #endif
  35. #if (BOOST_INTEL_CXX_VERSION <= 600)
  36. # if defined(_MSC_VER) && (_MSC_VER <= 1300) // added check for <= VC 7 (Peter Dimov)
  37. // Boost libraries assume strong standard conformance unless otherwise
  38. // indicated by a config macro. As configured by Intel, the EDG front-end
  39. // requires certain compiler options be set to achieve that strong conformance.
  40. // Particularly /Qoption,c,--arg_dep_lookup (reported by Kirk Klobe & Thomas Witt)
  41. // and /Zc:wchar_t,forScope. See boost-root/tools/build/intel-win32-tools.jam for
  42. // details as they apply to particular versions of the compiler. When the
  43. // compiler does not predefine a macro indicating if an option has been set,
  44. // this config file simply assumes the option has been set.
  45. // Thus BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP will not be defined, even if
  46. // the compiler option is not enabled.
  47. # define BOOST_NO_SWPRINTF
  48. # endif
  49. // Void returns, 64 bit integrals don't work when emulating VC 6 (Peter Dimov)
  50. # if defined(_MSC_VER) && (_MSC_VER <= 1200)
  51. # define BOOST_NO_VOID_RETURNS
  52. # define BOOST_NO_INTEGRAL_INT64_T
  53. # endif
  54. #endif
  55. #if (BOOST_INTEL_CXX_VERSION <= 710) && defined(_WIN32)
  56. # define BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS
  57. #endif
  58. // See http://aspn.activestate.com/ASPN/Mail/Message/boost/1614864
  59. #if BOOST_INTEL_CXX_VERSION < 600
  60. # define BOOST_NO_INTRINSIC_WCHAR_T
  61. #else
  62. // We should test the macro _WCHAR_T_DEFINED to check if the compiler
  63. // supports wchar_t natively. *BUT* there is a problem here: the standard
  64. // headers define this macro if they typedef wchar_t. Anyway, we're lucky
  65. // because they define it without a value, while Intel C++ defines it
  66. // to 1. So we can check its value to see if the macro was defined natively
  67. // or not.
  68. // Under UNIX, the situation is exactly the same, but the macro _WCHAR_T
  69. // is used instead.
  70. # if ((_WCHAR_T_DEFINED + 0) == 0) && ((_WCHAR_T + 0) == 0)
  71. # define BOOST_NO_INTRINSIC_WCHAR_T
  72. # endif
  73. #endif
  74. #if defined(__GNUC__) && !defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL)
  75. //
  76. // Figure out when Intel is emulating this gcc bug
  77. // (All Intel versions prior to 9.0.26, and versions
  78. // later than that if they are set up to emulate gcc 3.2
  79. // or earlier):
  80. //
  81. # if ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)) || (BOOST_INTEL < 900) || (__INTEL_COMPILER_BUILD_DATE < 20050912)
  82. # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
  83. # endif
  84. #endif
  85. #if (defined(__GNUC__) && (__GNUC__ < 4)) || defined(_WIN32) || (BOOST_INTEL_CXX_VERSION <= 1100)
  86. // GCC or VC emulation:
  87. #define BOOST_NO_TWO_PHASE_NAME_LOOKUP
  88. #endif
  89. //
  90. // Verify that we have actually got BOOST_NO_INTRINSIC_WCHAR_T
  91. // set correctly, if we don't do this now, we will get errors later
  92. // in type_traits code among other things, getting this correct
  93. // for the Intel compiler is actually remarkably fragile and tricky:
  94. //
  95. #if defined(BOOST_NO_INTRINSIC_WCHAR_T)
  96. #include <cwchar>
  97. template< typename T > struct assert_no_intrinsic_wchar_t;
  98. template<> struct assert_no_intrinsic_wchar_t<wchar_t> { typedef void type; };
  99. // if you see an error here then you need to unset BOOST_NO_INTRINSIC_WCHAR_T
  100. // where it is defined above:
  101. typedef assert_no_intrinsic_wchar_t<unsigned short>::type assert_no_intrinsic_wchar_t_;
  102. #else
  103. template< typename T > struct assert_intrinsic_wchar_t;
  104. template<> struct assert_intrinsic_wchar_t<wchar_t> {};
  105. // if you see an error here then define BOOST_NO_INTRINSIC_WCHAR_T on the command line:
  106. template<> struct assert_intrinsic_wchar_t<unsigned short> {};
  107. #endif
  108. #if _MSC_VER+0 >= 1000
  109. # if _MSC_VER >= 1200
  110. # define BOOST_HAS_MS_INT64
  111. # endif
  112. # define BOOST_NO_SWPRINTF
  113. # define BOOST_NO_TWO_PHASE_NAME_LOOKUP
  114. #elif defined(_WIN32)
  115. # define BOOST_DISABLE_WIN32
  116. #endif
  117. // I checked version 6.0 build 020312Z, it implements the NRVO.
  118. // Correct this as you find out which version of the compiler
  119. // implemented the NRVO first. (Daniel Frey)
  120. #if (BOOST_INTEL_CXX_VERSION >= 600)
  121. # define BOOST_HAS_NRVO
  122. #endif
  123. //
  124. // versions check:
  125. // we don't support Intel prior to version 5.0:
  126. #if BOOST_INTEL_CXX_VERSION < 500
  127. # error "Compiler not supported or configured - please reconfigure"
  128. #endif
  129. // Intel on MacOS requires
  130. #if defined(__APPLE__) && defined(__INTEL_COMPILER)
  131. # define BOOST_NO_TWO_PHASE_NAME_LOOKUP
  132. #endif
  133. // Intel on Altix Itanium
  134. #if defined(__itanium__) && defined(__INTEL_COMPILER)
  135. # define BOOST_NO_TWO_PHASE_NAME_LOOKUP
  136. #endif
  137. //
  138. // last known and checked version:
  139. #if (BOOST_INTEL_CXX_VERSION > 1100)
  140. # if defined(BOOST_ASSERT_CONFIG)
  141. # error "Unknown compiler version - please run the configure tests and report the results"
  142. # elif defined(_MSC_VER)
  143. //
  144. // We don't emit this warning any more, since we have so few
  145. // defect macros set anyway (just the one).
  146. //
  147. //# pragma message("Unknown compiler version - please run the configure tests and report the results")
  148. # endif
  149. #endif