Config question: BOOST_NO_INTRINSIC_WCHAR_T (Intel 7.1)
Hello folks, I'm just getting around to upgrade to Boost 1_31_0 from Boost 1_30_0. I'm attempting to use 1_31_0 out-of-the-box (w/no bjam) but am confused about how to resolve problems related to native wchar_t support (or lack thereof). Some details: I'm using MSV6 with the Intel 7.1 compiler. Specifically I'm using: Intel(R) C++ Compiler for 32-bit applications, Version 7.1 Build 20030609Z I added a few #pragma messages to the config headers and have verified that config indeed seems to making the right decisions - at least at a high level: [Boost Configure: Selected Intel Compiler] [Boost Configure: Selected STLport Standard Library] [Boost Configure: Selected Win32 Platform] The specific error I encounter: d:\ENCAPSULE-EXTLIB\boost\boost_1_31_0\boost_1_31_0\boost/type_traits/is_inte gral.hpp(38): error: class "boost::is_integral<unsigned short>" has already been defined BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true) ^ d:\ENCAPSULE-EXTLIB\boost\boost_1_31_0\boost_1_31_0\boost/type_traits/is_inte gral.hpp(38): error: class "boost::is_integral<const unsigned short>" has already been defined BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true) ^ d:\ENCAPSULE-EXTLIB\boost\boost_1_31_0\boost_1_31_0\boost/type_traits/is_inte gral.hpp(38): error: class "boost::is_integral<volatile unsigned short>" has already been defined BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true) ^ d:\ENCAPSULE-EXTLIB\boost\boost_1_31_0\boost_1_31_0\boost/type_traits/is_inte gral.hpp(38): 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) ^ ... tracked back into .../1_31_0/boost/type_traits/is_integral.hpp #ifndef BOOST_NO_INTRINSIC_WCHAR_T BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true) #endif ... where BOOST_NO_INTRINSIC_WCHAR_T is defined in ../1_31_0/boost/config/compiler/intel.hpp // See http://aspn.activestate.com/ASPN/Mail/Message/boost/1614864 #if BOOST_INTEL_CXX_VERSION < 700 # define BOOST_NO_INTRINSIC_WCHAR_T #else // _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 #endif I read the post on ActiveState but I'm still confused. With the frequency of Intel compiler updates is it possible this particular release is not setting the expected macros correctly? If someone could give me a kick in the right direction I would appreciate it. I really want to try some of these nifty Spirit v1.8 facilities (wow Joel). - Thanks Chris
Some additional information pertaining to BOOST_NO_INTRINSIC_WCHAR_T using the Intel C++ 7.1 compiler in my MSVC 6 SP6 environment: Using Boost v1.31.0 + STLport v5.0-125 + Intel C++ v7.1 (I updated to build 20030910Z) inside of MSVC 6 SP6 with a fairly recent MS Platform SDK, I simply could not get boost/config/compiler/intel.hpp to send me down the road to glory. Inside of config/compiler/intel.hpp, _WCHAR_T_DEFINED is defined resulting in BOOST_NO_INTRINSIC_WCHAR_T not being set. Subsequently, this results in the compile-time error: boost/type_traits/is_integral.hpp(38): error: class "boost::is_integral<unsigned short>" has already been defined Per "Compiler errors with Intel 7.1 and type_traits" (http://lists.boost.org/MailArchives/boost/msg53033.php), specifically John Maddock's reply (http://lists.boost.org/MailArchives/boost/msg53121.php), I short-circuited the logic in config/compiler/intel.hpp and explicitly defined BOOST_NO_INTRINSIC_WCHAR_T in config/user.hpp. This seems to work acceptably for this project. But I'm not at all comfortable with this solution because I really don't understand what the fundamental issue is with all this wchar_t stuff. Forgive my ignorance but if, with my current working config, if I declare a wchar_t type in my code I will get a 16-bit UCS-2 character. Correct? Having now poured over all postings related to this subject in the archive, I have an inkling that the root of all this stems from the way the compiler handles type aliasing? That is, with BOOST_NO_INTRINSIC_WCHAR_T a defined a wchar_t is actually an alias for an unsigned int whereas in the case !defined(BOOST_NO_INTRINSIC_WCHAR_T), the compiler treats wchar_t as an intrinsic type? And from this we get these template specialization errors? Or am I way off? - Regards Chris
I'm just getting around to upgrade to Boost 1_31_0 from Boost 1_30_0. I'm attempting to use 1_31_0 out-of-the-box (w/no bjam) but am confused about how to resolve problems related to native wchar_t support (or lack thereof).
Sadly Intel do not define the macros we need to detect whether wchar_t is a built in type or not, if it's not then you have to set the compiler config macro BOOST_NO_INTRINSIC_WCHAR_T yourself. And yes we know this is pain, and yes we've been through three kinds of hell trying to solve it, but with no luck. John.
Thanks to Ben, Aleksey & John for the quick responses.
And yes we know this is pain Actually adding a command line switch, or punching the define into user.hpp isn't all too bad in the grand scheme of things.
Until Intel provides the cues required, may I suggest that a comment be
placed in boost/type_traits/is_integral.h at line 38:
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
// If the following line fails to compile and you're using the Intel
compiler, see http://lists.boost.org/MailArchives/boost-users/msg06567.php
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true)
#endif
- Regards
Chris
"John Maddock"
I'm just getting around to upgrade to Boost 1_31_0 from Boost 1_30_0. I'm attempting to use 1_31_0 out-of-the-box (w/no bjam) but am confused about how to resolve problems related to native wchar_t support (or lack thereof).
Sadly Intel do not define the macros we need to detect whether wchar_t is a built in type or not, if it's not then you have to set the compiler config macro BOOST_NO_INTRINSIC_WCHAR_T yourself. And yes we know this is pain, and yes we've been through three kinds of hell trying to solve it, but with no luck.
John.
Thanks to Ben, Aleksey & John for the quick responses.
And yes we know this is pain Actually adding a command line switch, or punching the define into user.hpp isn't all too bad in the grand scheme of things.
Until Intel provides the cues required, may I suggest that a comment be placed in boost/type_traits/is_integral.h at line 38:
#ifndef BOOST_NO_INTRINSIC_WCHAR_T // If the following line fails to compile and you're using the Intel compiler, see http://lists.boost.org/MailArchives/boost-users/msg06567.php BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true) #endif
Will do. John.
participants (2)
-
Christopher D. Russell
-
John Maddock