blob: 921683154c1c1bb524da576169adc7424529dc60 [file] [log] [blame]
Jeff Thompsonf7d49942013-08-01 16:47:40 -07001// (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
Jeff Thompson2277ce52013-08-01 17:34:11 -070017#include "ndnboost/config/compiler/common_edg.hpp"
Jeff Thompsonf7d49942013-08-01 16:47:40 -070018
19#if defined(__INTEL_COMPILER)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070020# define NDNBOOST_INTEL_CXX_VERSION __INTEL_COMPILER
Jeff Thompsonf7d49942013-08-01 16:47:40 -070021#elif defined(__ICL)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070022# define NDNBOOST_INTEL_CXX_VERSION __ICL
Jeff Thompsonf7d49942013-08-01 16:47:40 -070023#elif defined(__ICC)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070024# define NDNBOOST_INTEL_CXX_VERSION __ICC
Jeff Thompsonf7d49942013-08-01 16:47:40 -070025#elif defined(__ECC)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070026# define NDNBOOST_INTEL_CXX_VERSION __ECC
Jeff Thompsonf7d49942013-08-01 16:47:40 -070027#endif
28
29// Flags determined by comparing output of 'icpc -dM -E' with and without '-std=c++0x'
Jeff Thompson3d613fd2013-10-15 15:39:04 -070030#if (!(defined(_WIN32) || defined(_WIN64)) && defined(__STDC_HOSTED__) && (__STDC_HOSTED__ && (NDNBOOST_INTEL_CXX_VERSION <= 1200))) || defined(__GXX_EXPERIMENTAL_CPP0X__)
31# define NDNBOOST_INTEL_STDCXX0X
Jeff Thompsonf7d49942013-08-01 16:47:40 -070032#endif
33#if defined(_MSC_VER) && (_MSC_VER >= 1600)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070034# define NDNBOOST_INTEL_STDCXX0X
Jeff Thompsonf7d49942013-08-01 16:47:40 -070035#endif
36
Jeff Thompson3d613fd2013-10-15 15:39:04 -070037#ifdef NDNBOOST_INTEL_STDCXX0X
38#define NDNBOOST_COMPILER "Intel C++ C++0x mode version " NDNBOOST_STRINGIZE(NDNBOOST_INTEL_CXX_VERSION)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070039#else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070040#define NDNBOOST_COMPILER "Intel C++ version " NDNBOOST_STRINGIZE(NDNBOOST_INTEL_CXX_VERSION)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070041#endif
Jeff Thompson3d613fd2013-10-15 15:39:04 -070042#define NDNBOOST_INTEL NDNBOOST_INTEL_CXX_VERSION
Jeff Thompsonf7d49942013-08-01 16:47:40 -070043
44#if defined(_WIN32) || defined(_WIN64)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070045# define NDNBOOST_INTEL_WIN NDNBOOST_INTEL
Jeff Thompsonf7d49942013-08-01 16:47:40 -070046#else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070047# define NDNBOOST_INTEL_LINUX NDNBOOST_INTEL
Jeff Thompsonf7d49942013-08-01 16:47:40 -070048#endif
49
Jeff Thompson3d613fd2013-10-15 15:39:04 -070050#if (NDNBOOST_INTEL_CXX_VERSION <= 500) && defined(_MSC_VER)
51# define NDNBOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
52# define NDNBOOST_NO_TEMPLATE_TEMPLATES
Jeff Thompsonf7d49942013-08-01 16:47:40 -070053#endif
54
Jeff Thompson3d613fd2013-10-15 15:39:04 -070055#if (NDNBOOST_INTEL_CXX_VERSION <= 600)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070056
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.
Jeff Thompson3d613fd2013-10-15 15:39:04 -070067// Thus NDNBOOST_NO_ARGUMENT_DEPENDENT_LOOKUP will not be defined, even if
Jeff Thompsonf7d49942013-08-01 16:47:40 -070068// the compiler option is not enabled.
69
Jeff Thompson3d613fd2013-10-15 15:39:04 -070070# define NDNBOOST_NO_SWPRINTF
Jeff Thompsonf7d49942013-08-01 16:47:40 -070071# 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)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070076# define NDNBOOST_NO_VOID_RETURNS
77# define NDNBOOST_NO_INTEGRAL_INT64_T
Jeff Thompsonf7d49942013-08-01 16:47:40 -070078# endif
79
80#endif
81
Jeff Thompson3d613fd2013-10-15 15:39:04 -070082#if (NDNBOOST_INTEL_CXX_VERSION <= 710) && defined(_WIN32)
83# define NDNBOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070084#endif
85
86// See http://aspn.activestate.com/ASPN/Mail/Message/boost/1614864
Jeff Thompson3d613fd2013-10-15 15:39:04 -070087#if NDNBOOST_INTEL_CXX_VERSION < 600
88# define NDNBOOST_NO_INTRINSIC_WCHAR_T
Jeff Thompsonf7d49942013-08-01 16:47:40 -070089#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)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070099# define NDNBOOST_NO_INTRINSIC_WCHAR_T
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700100# endif
101#endif
102
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700103#if defined(__GNUC__) && !defined(NDNBOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL)
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700104//
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//
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700110# if ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)) || (NDNBOOST_INTEL < 900) || (__INTEL_COMPILER_BUILD_DATE < 20050912)
111# define NDNBOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700112# endif
113#endif
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700114#if (defined(__GNUC__) && (__GNUC__ < 4)) || defined(_WIN32) || (NDNBOOST_INTEL_CXX_VERSION <= 1200)
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700115// GCC or VC emulation:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700116#define NDNBOOST_NO_TWO_PHASE_NAME_LOOKUP
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700117#endif
118//
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700119// Verify that we have actually got NDNBOOST_NO_INTRINSIC_WCHAR_T
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700120// 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
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700125#if defined(NDNBOOST_NO_INTRINSIC_WCHAR_T)
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700126#include <cwchar>
127template< typename T > struct assert_no_intrinsic_wchar_t;
128template<> struct assert_no_intrinsic_wchar_t<wchar_t> { typedef void type; };
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700129// if you see an error here then you need to unset NDNBOOST_NO_INTRINSIC_WCHAR_T
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700130// where it is defined above:
131typedef assert_no_intrinsic_wchar_t<unsigned short>::type assert_no_intrinsic_wchar_t_;
132#else
133template< typename T > struct assert_intrinsic_wchar_t;
134template<> struct assert_intrinsic_wchar_t<wchar_t> {};
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700135// if you see an error here then define NDNBOOST_NO_INTRINSIC_WCHAR_T on the command line:
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700136template<> 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
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700142# define NDNBOOST_HAS_MS_INT64
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700143# endif
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700144# define NDNBOOST_NO_SWPRINTF
145# define NDNBOOST_NO_TWO_PHASE_NAME_LOOKUP
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700146#elif defined(_WIN32)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700147# define NDNBOOST_DISABLE_WIN32
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700148#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)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700153#if (NDNBOOST_INTEL_CXX_VERSION >= 600)
154# define NDNBOOST_HAS_NRVO
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700155#endif
156
157//
158// versions check:
159// we don't support Intel prior to version 5.0:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700160#if NDNBOOST_INTEL_CXX_VERSION < 500
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700161# error "Compiler not supported or configured - please reconfigure"
162#endif
163
164// Intel on MacOS requires
165#if defined(__APPLE__) && defined(__INTEL_COMPILER)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700166# define NDNBOOST_NO_TWO_PHASE_NAME_LOOKUP
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700167#endif
168
169// Intel on Altix Itanium
170#if defined(__itanium__) && defined(__INTEL_COMPILER)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700171# define NDNBOOST_NO_TWO_PHASE_NAME_LOOKUP
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700172#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)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700184# if (__INTEL_COMPILER <= 1110) || (__INTEL_COMPILER == 9999) || (defined(_WIN32) && (__INTEL_COMPILER < 1500))
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700185# define NDNBOOST_NO_COMPLETE_VALUE_INITIALIZATION
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700186# endif
187#endif
188
189//
190// Dynamic shared object (DSO) and dynamic-link library (DLL) support
191//
192#if defined(__GNUC__) && (__GNUC__ >= 4)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700193# define NDNBOOST_SYMBOL_EXPORT __attribute__((visibility("default")))
194# define NDNBOOST_SYMBOL_IMPORT
195# define NDNBOOST_SYMBOL_VISIBLE __attribute__((visibility("default")))
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700196#endif
197//
198// C++0x features
199// - ICC added static_assert in 11.0 (first version with C++0x support)
200//
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700201#if defined(NDNBOOST_INTEL_STDCXX0X)
202# undef NDNBOOST_NO_CXX11_STATIC_ASSERT
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700203//
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//
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700207//# undef NDNBOOST_NO_CXX11_LAMBDAS
208//# undef NDNBOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
209//# undef NDNBOOST_NO_CXX11_DECLTYPE
210//# undef NDNBOOST_NO_CXX11_AUTO_DECLARATIONS
211//# undef NDNBOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700212#endif
213
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700214#if defined(NDNBOOST_INTEL_STDCXX0X) && (NDNBOOST_INTEL_CXX_VERSION >= 1200)
215//# undef NDNBOOST_NO_CXX11_RVALUE_REFERENCES // Enabling this breaks Filesystem and Exception libraries
216//# undef NDNBOOST_NO_CXX11_SCOPED_ENUMS // doesn't really work!!
217# undef NDNBOOST_NO_CXX11_DELETED_FUNCTIONS
218# undef NDNBOOST_NO_CXX11_DEFAULTED_FUNCTIONS
219# undef NDNBOOST_NO_CXX11_LAMBDAS
220# undef NDNBOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
221# undef NDNBOOST_NO_CXX11_DECLTYPE
222# undef NDNBOOST_NO_CXX11_AUTO_DECLARATIONS
223# undef NDNBOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700224#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.
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700228#if defined(NDNBOOST_INTEL_STDCXX0X) && (NDNBOOST_INTEL_CXX_VERSION > 1200)
229# undef NDNBOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
230# undef NDNBOOST_NO_CXX11_NULLPTR
231# undef NDNBOOST_NO_CXX11_RVALUE_REFERENCES
232# undef NDNBOOST_NO_SFINAE_EXPR
233# undef NDNBOOST_NO_CXX11_TEMPLATE_ALIASES
234# undef NDNBOOST_NO_CXX11_VARIADIC_TEMPLATES
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700235
236// http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler/
237// continues to list scoped enum support as "Partial"
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700238//# undef NDNBOOST_NO_CXX11_SCOPED_ENUMS
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700239#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//
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700245# define NDNBOOST_NO_CXX11_HDR_INITIALIZER_LIST
246# define NDNBOOST_NO_CXX11_VARIADIC_TEMPLATES
247# define NDNBOOST_NO_CXX11_DELETED_FUNCTIONS
248# define NDNBOOST_NO_CXX11_DEFAULTED_FUNCTIONS
249# define NDNBOOST_NO_CXX11_TEMPLATE_ALIASES
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700250#endif
251
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700252#if (NDNBOOST_INTEL_CXX_VERSION < 1200)
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700253//
254// fenv.h appears not to work with Intel prior to 12.0:
255//
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700256# define NDNBOOST_NO_FENV_H
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700257#endif
258
259//
260// last known and checked version:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700261#if (NDNBOOST_INTEL_CXX_VERSION > 1200)
262# if defined(NDNBOOST_ASSERT_CONFIG)
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700263# 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