Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-10-01 10:02:07


"Stefan Slapeta" <stefan_at_[hidden]> writes:

> Hi all,
>
> I'm sorry if this has been reported yet, but I didn't find anything.
>
> With 1.30.2, this include sequence results in compiler errors with Intel 7.1 +
> MSVC 6.0:
>
> <code>
> #include <cstdio>
> #include <boost/type_traits.hpp>
> </code>
>
>
> C:\boost-1.30.2\boost/type_traits/is_integral.hpp(39): error: class
> "boost::is_integral<unsigned short>" has already been defined
> BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true)
> ^
> C:\boost-1.30.2\boost/type_traits/is_integral.hpp(39): error: class
> "boost::is_integral<const unsigned short>" has already been defined
> BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true)
> ^
> C:\boost-1.30.2\boost/type_traits/is_integral.hpp(39): error: class
> "boost::is_integral<volatile unsigned short>" has already been defined
> BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true)
> ^
> C:\boost-1.30.2\boost/type_traits/is_integral.hpp(39): error: class
> "boost::is_integral<const volatile unsigned short>" has already been defined
> BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true)
> ^
>
>
> A recent change in intel.hpp is responsible for this:
>
> <boost>
> // _WCHAR_T_DEFINED is the Win32 spelling
> // _WCHAR_T is the Linux spelling
> # if !defined(_WCHAR_T_DEFINED) && !defined(_WCHAR_T)
> # define BOOST_NO_INTRINSIC_WCHAR_T
> # endif
> </boost>
>
>
> _WCHAR_T_DEFINED is not only defined by icc, but also in exactly 15 MSVC
> c-runtime headers and can therefore not be taken as an indicator for the
> presence of a native wchar_t!

If you use Boost.Build to compile your test, you'll see that it
works, because when your INTEL_BASE_MSVC_TOOLSET is "msvc" (vc6) it
adds -DBOOST_NO_INTRINSIC_WCHAR_T to your command line.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk