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