Boost logo

Boost :

From: Stefan Slapeta (stefan_at_[hidden])
Date: 2003-10-01 09:38:13


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!
IMHO, the approach to define the same macro if wchar_t is a native type is not
very sophisticated, at least they (Intel) could have defined something else
additionally. I'll submit a DR to Intel, maybe they can do something more with
8.0.

Regards,

Stefan


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