[config] Patch for Intel 8.0 + Dinkum lib

Intel C++ for Windows never stops surprising me with its Microsoft bugtibility conundrums. When you use /Qms0 (version 8.0) it defines _MSC_VER to be 1200, as if it emulated VC++6! This tricks up the code in config/stdlib/dinkumware.hpp to define # define BOOST_NO_STD_USE_FACET # define BOOST_HAS_TWO_ARG_USE_FACET However the two-arg version of use_facet is deprecated and marked as such with __declspec(deprecated). Attached is an obvious patch to fix the problem. -- Genny. begin 644 dinkumpatch.txt M*BHJ(&1I;FMU;7=A<F4N:'!P+F]R:6<)5'5E($9E8B`@,R`Q,SHT,3HT-2`R M,#`T"BTM+2!D:6YK=6UW87)E+FAP<`E&<FD@36%R(#$R(#$X.C(W.C,T(#(P M,#0**BHJ*BHJ*BHJ*BHJ*BHJ"BHJ*B`R.2PS-B`J*BHJ"B`@(R`@("`@9&5F M:6YE($)/3U-47TY/7U-41%]!3$Q/0T%43U(-"B`@(R`@96YD:68-"B`@(R`@ M9&5F:6YE($)/3U-47TA!4U]005)424%,7U-41%]!3$Q/0T%43U(-"B$@(R`@ M:68@*&1E9FEN960H7TU30U]615(I("8F("A?35-#7U9%4B`\(#$S,#`I*2`F M)B`A9&5F:6YE9"A?7T)/4DQ!3D1#7U\I#0H@("`@("`@("\O(&EF('1H:7,@ M;&EB('9E<G-I;VX@:7,@<V5T('5P(&9O<B!V8S8@=&AE;B!T:&5R92!I<R!N M;R!S=&0Z.G5S95]F86-E=#H-"B`@(R`@("`@9&5F:6YE($)/3U-47TY/7U-4 M1%]54T5?1D%#150-"B`@(R`@("`@9&5F:6YE($)/3U-47TA!4U]45T]?05)' M7U5315]&04-%5`T*("`@("`@("`O+R!#(&QI8B!F=6YC=&EO;G,@87)E;B=T M(&EN(&YA;65S<&%C92!S=&0@96ET:&5R.@T*+2TM(#(Y+#,W("TM+2T*("`C M("`@("!D969I;F4@0D]/4U1?3D]?4U1$7T%,3$]#051/4@T*("`C("!E;F1I M9@T*("`C("!D969I;F4@0D]/4U1?2$%37U!!4E1)04Q?4U1$7T%,3$]#051/ M4@T*(2`C("!I9B`H9&5F:6YE9"A?35-#7U9%4BD@)B8@*%]-4T-?5D52(#P@ M,3,P,"D@)B8@0D]/4U1?24Y414Q?0UA87U9%4E-)3TX@/"`X,#`I("8F("%D M969I;F5D*%]?0D]23$%.1$-?7RD-"B`@("`@("`@+R\@:68@=&AI<R!L:6(@ M=F5R<VEO;B!I<R!S970@=7`@9F]R('9C-B!T:&5N('1H97)E(&ES(&YO('-T M9#HZ=7-E7V9A8V5T.@T**R`@("`@("`O+R`H8V%U=&EO;CH@26YT96P@."XP M(&9O<B!7:6X@=VET:"`O46US,"!D969I;F5S(%]-4T-?5D52('1O(&)E(#$R M,#`@8G5T(&ET(&ES(&YO="!60S8A*0T*("`C("`@("!D969I;F4@0D]/4U1? M3D]?4U1$7U5315]&04-%5`T*("`C("`@("!D969I;F4@0D]/4U1?2$%37U17 M3U]!4D=?55-%7T9!0T54#0H@("`@("`@("\O($,@;&EB(&9U;F-T:6]N<R!A @<F5N)W0@:6X@;F%M97-P86-E('-T9"!E:71H97(Z#0IB ` end

Gennaro Prota <gennaro_prota@yahoo.com> writes:
Intel C++ for Windows never stops surprising me with its Microsoft bugtibility conundrums. When you use /Qms0 (version 8.0) it defines _MSC_VER to be 1200, as if it emulated VC++6!
CRIMINY!!!! Did you report this as a bug to Intel?!? -- Dave Abrahams Boost Consulting www.boost-consulting.com

On Fri, 12 Mar 2004 14:20:08 -0500, David Abrahams <dave@boost-consulting.com> wrote:
Gennaro Prota <gennaro_prota@yahoo.com> writes:
Intel C++ for Windows never stops surprising me with its Microsoft bugtibility conundrums. When you use /Qms0 (version 8.0) it defines _MSC_VER to be 1200, as if it emulated VC++6!
CRIMINY!!!!
:)
Did you report this as a bug to Intel?!?
I've now verified that it *always* defines _MSC_VER to be 1200, except when you use /Qvc7.1. Aarghh. FWIW, the compiler user's guide just says that on IA-32 _MSC_VER is 1200. No, I've no idea of how to report bugs to Intel. However I have an unpatched evaluation version (8.0.040). Can you verify if 8.0.042 has the same problem? -- Genny.

Gennaro Prota <gennaro_prota@yahoo.com> writes:
On Fri, 12 Mar 2004 14:20:08 -0500, David Abrahams <dave@boost-consulting.com> wrote:
Gennaro Prota <gennaro_prota@yahoo.com> writes:
Intel C++ for Windows never stops surprising me with its Microsoft bugtibility conundrums. When you use /Qms0 (version 8.0) it defines _MSC_VER to be 1200, as if it emulated VC++6!
CRIMINY!!!!
:)
Did you report this as a bug to Intel?!?
I've now verified that it *always* defines _MSC_VER to be 1200, except when you use /Qvc7.1. Aarghh. FWIW, the compiler user's guide just says that on IA-32 _MSC_VER is 1200.
No, I've no idea of how to report bugs to Intel. However I have an unpatched evaluation version (8.0.040). Can you verify if 8.0.042 has the same problem?
Nope, sorry; I'm getting ready to travel to the other side of the world. No time for much of anything. Best I can do is Bcc: someone I know at Intel, knowing that pleas to do only sensible things with compiler spoofing (like *not* doing it) will fall on deaf ears over there :( -- Dave Abrahams Boost Consulting www.boost-consulting.com

// No, I've no idea of how to report bugs to Intel. However I have an // unpatched evaluation version (8.0.040). Can you verify if 8.0.042 has // the same problem? I've submitted a defect report. Stefan

On Sat, 13 Mar 2004 19:07:39 +0100, "Stefan Slapeta" <stefan@slapeta.com> wrote:
// No, I've no idea of how to report bugs to Intel. However I have an // unpatched evaluation version (8.0.040). Can you verify if 8.0.042 has // the same problem?
I've submitted a defect report.
Thanks, Stefan. I doubt they will fix the situation though. I wish I could use the --microsoft_version switch of EDG, but it doesn't work either :) And, anyway, that wouldn't be a solution for boost (at least not for header-only libraries). Let's see what John says about the config system. -- Genny.

// -----Original Message----- // From: boost-bounces@lists.boost.org // [mailto:boost-bounces@lists.boost.org] On Behalf Of Gennaro Prota // // Thanks, Stefan. I doubt they will fix the situation though. I wish I // could use the --microsoft_version switch of EDG, but it doesn't work // either :) I think they will do and, as I know Intel, if they do they do it quickly. I don't know how it influences the macro configuration, but what you are looking for is /Qoption,cpp,--microsoft_version=1310 Stefan

On Sat, 13 Mar 2004 20:52:15 +0100, "Stefan Slapeta" <stefan@slapeta.com> wrote:
I don't know how it influences the macro configuration, but what you are looking for is
/Qoption,cpp,--microsoft_version=1310
I know how to pass options to the front-end. This however doesn't work, as I said. No dice. (I prefer using ",c" instead of ",cpp" and for a moment you made me suspect that ",cpp" worked :)) -- Genny.

Thanks, Stefan. I doubt they will fix the situation though. I wish I could use the --microsoft_version switch of EDG, but it doesn't work either :) And, anyway, that wouldn't be a solution for boost (at least not for header-only libraries). Let's see what John says about the config system.
I'm keeping quite and hoping that someone else will solve the issue :-) If my understanding is correct, then: * we need to detect whether the std lib was the one that shipped with vc6, 7 or 7.1 but: * we can't use _MSC_VER because it gets set to arbitrary values. * we can't use the Intel compiler version because Intel 8 can sit on top of vc6 and 7 as well as 7.1 * so we need a method that relies on the std lib alone, except that there isn't one.. Is that right? John.

"John Maddock" <john@johnmaddock.co.uk> wrote: // If my understanding is correct, then: // // * we need to detect whether the std lib was the one that shipped with vc6, 7 // or 7.1 but: // * we can't use _MSC_VER because it gets set to arbitrary values. // * we can't use the Intel compiler version because Intel 8 can sit on top of // vc6 and 7 as well as 7.1 // * so we need a method that relies on the std lib alone, except that there // isn't one.. // I have proposed not to set this macro at all if there is no VCxx switch found on the command line. This, however, would imply that boost must be able to handle this state AND interprets it as 'strictly conformant'. Stefan

On Mon, 15 Mar 2004 13:28:57 -0000, "John Maddock" <john@johnmaddock.co.uk> wrote:
I'm keeping quite and hoping that someone else will solve the issue :-)
:) [PS: out of curiosity, is 'quite' a typo for 'quiet' or a sort of play on words?]
If my understanding is correct,
Hmm... when you say so I begin worrying :)
then:
* we need to detect whether the std lib was the one that shipped with vc6, 7 or 7.1 but:
Well, we can assume that the version shipped with VC6 is used with VC6 only, can't we?. It's newer lib versions that can be used with everything (maybe - please confirm this :)).
* we can't use _MSC_VER because it gets set to arbitrary values.
Yes. But I have a question: can we assume that the compiler is always detected *before* the library? Currently that's what the config system does. If it isn't a problem to cast this fact in stone, then the library config could just use BOOST_MSVC. I would go further: I think once the compiler config has identified a compiler it should make available those information to the user (the library writer). That is, there should be e.g. a BOOST_GCC defined for g++, but not for Intel in gcc compatibility mode. That's something I need very often and needs just a simple #define for each compiler config file. Without that, say, for instance, I need to workaround a gcc bug (as it happened to me yesterday); then I have to do something like this: #if defined __GNUC__ && !defined BOOST_INTEL_CXX_VERSION \ && /* not compiler xyz1 emulating g++*/ \ && /* not compiler xyz2 .... \ ... workaround code... #endif when I could just do #if defined BOOST_GCC ... workaround code... #endif That also makes library code immune if new compilers that emulate g++ are introduced: you only change the config files (which need to be changed anyway) and the library code works as a consequence.
[snip]
-- Genny

:) [PS: out of curiosity, is 'quite' a typo for 'quiet' or a sort of play on words?]
Sorry, typo.
If my understanding is correct,
Hmm... when you say so I begin worrying :)
:-)
then:
* we need to detect whether the std lib was the one that shipped with vc6, 7 or 7.1 but:
Well, we can assume that the version shipped with VC6 is used with VC6 only, can't we?. It's newer lib versions that can be used with everything (maybe - please confirm this :)).
* we can't use _MSC_VER because it gets set to arbitrary values.
Yes. But I have a question: can we assume that the compiler is always detected *before* the library? Currently that's what the config system does. If it isn't a problem to cast this fact in stone, then the library config could just use BOOST_MSVC.
Yes, it's detected first, and yes we can use BOOST_MSVC to detect "real" msvc, but that doesn't help with the Intel config: As far as I can tell from Intels docs, all it's predefined macros are set to the same values irrespective of whether it's been installed on top of VC6, VC7, or VC7.1.
I would go further: I think once the compiler config has identified a compiler it should make available those information to the user (the library writer). That is, there should be e.g. a BOOST_GCC defined for g++, but not for Intel in gcc compatibility mode. That's something I need very often and needs just a simple #define for each compiler config file. Without that, say, for instance, I need to workaround a gcc bug (as it happened to me yesterday); then I have to do something like this:
#if defined __GNUC__ && !defined BOOST_INTEL_CXX_VERSION \ && /* not compiler xyz1 emulating g++*/ \ && /* not compiler xyz2 .... \ ... workaround code... #endif
when I could just do
#if defined BOOST_GCC ... workaround code... #endif
That also makes library code immune if new compilers that emulate g++ are introduced: you only change the config files (which need to be changed anyway) and the library code works as a consequence.
Yep, good idea, it just doesn't solve this issue :-( John.

On Tue, 16 Mar 2004 16:15:14 -0000, "John Maddock" <john@johnmaddock.co.uk> wrote:
Yes, it's detected first, and yes we can use BOOST_MSVC to detect "real" msvc, but that doesn't help with the Intel config:
As far as I can tell from Intels docs, all it's predefined macros are set to the same values irrespective of whether it's been installed on top of VC6, VC7, or VC7.1.
Yes, but I don't think it emulates the compiler it is installed on top of. Does it? I suppose Intel 8.0, for instance, is always VC7.1-like in the language support, even if installed on top of VC6. What "remains" of the underlying VC installation, besides the linker etc., is the (non-)standard library. But that is detectable with certainty.
[...] Yep, good idea, it just doesn't solve this issue :-(
Is this ironical? I really think it is a good idea! :) -- Genny

Yes, but I don't think it emulates the compiler it is installed on top of. Does it? I suppose Intel 8.0, for instance, is always VC7.1-like in the language support, even if installed on top of VC6.
That's right.
What "remains" of the underlying VC installation, besides the linker etc., is the (non-)standard library. But that is detectable with certainty.
Is it, how? That's the key issue as I see it.
[...] Yep, good idea, it just doesn't solve this issue :-(
Is this ironical? I really think it is a good idea! :)
So do I, no irony intended. Thanks, John.

On Wed, 17 Mar 2004 12:50:04 -0000, "John Maddock" <john@johnmaddock.co.uk> wrote:
What "remains" of the underlying VC installation, besides the linker etc., is the (non-)standard library. But that is detectable with certainty.
Is it, how?
Just like you do now. Am I missing something? (With "that" I meant "the library"). In stdlib/dinkumware.hpp there's, for instance: #if defined(_CPPLIB_VER) && (_CPPLIB_VER >= 306) // full dinkumware 3.06 and above // the library is conforming; but some features // can't be used if the compiler is (real) VC6 // # if THIS_IS_REAL_VC6 /* defined BOOST_MSVC &&... */ # define BOOST_NO_STD_USE_FACET # define BOOST_HAS_TWO_ARG_USE_FACET ... # endif #else // <old version: has defects, regardless of the compiler> # define BOOST_MSVC_STD_ITERATOR 1 # define BOOST_NO_STD_ITERATOR # define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS ... #endif Isn't that enough? -- Genny.

Just like you do now. Am I missing something? (With "that" I meant "the library"). In stdlib/dinkumware.hpp there's, for instance:
#if defined(_CPPLIB_VER) && (_CPPLIB_VER >= 306) // full dinkumware 3.06 and above
// the library is conforming; but some features // can't be used if the compiler is (real) VC6 // # if THIS_IS_REAL_VC6 /* defined BOOST_MSVC &&... */ # define BOOST_NO_STD_USE_FACET # define BOOST_HAS_TWO_ARG_USE_FACET ... # endif
#else
// <old version: has defects, regardless of the compiler>
# define BOOST_MSVC_STD_ITERATOR 1 # define BOOST_NO_STD_ITERATOR # define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS ...
#endif
Isn't that enough?
Sounds like it's close enough, it might fail for people with VC6 + Intel and an updated Dinkum library, but that'll just have to be too bad, changes in mainline cvs now. John.

On Thu, 18 Mar 2004 11:26:37 -0000, "John Maddock" <john@johnmaddock.co.uk> wrote:
Sounds like it's close enough, it might fail for people with VC6 + Intel and an updated Dinkum library,
Why?
but that'll just have to be too bad, changes in mainline cvs now.
Thanks. Now, pardon me if I have other questions (all concerning the part that follows the #if/#endif above): - shouldn't the test for BOOST_STD_EXTENSION_NAMESPACE be based on the *library* version, rather than _MSC_VER? - shouldn't BOOST_NO_STD_ITERATOR_TRAITS test for "real" VC6? <debatable> At the cost of duplicating the definition, maybe it would be clearer to do: #if defined(_CPPLIB_VER) && (_CPPLIB_VER >= 306) // full Dinkum # if REAL_VC6 ... # define BOOST_NO_STD_ITERATOR_TRAITS // <--- # endif #else // old Dinkum ... # define BOOST_NO_STD_ITERATOR_TRAITS // <--- #endif </debatable> - The test for BOOST_NO_STD_LOCALE is really restrictive. Fortunately it only refers to the Dinkum lib shipping with VC7. However if many of our users use Intel C++ with that library then it might be worth to soften it, because it really prevents a lot of code to work. (Well, this is not really a question :)) PS: I'm not one who claims that others do work that he could do. It's just that these issues are a bit delicate and I wanted to see with you if there's any problem I'm missing. After that, I could commit the changes for you, if you like. This also holds for the compiler identification macros, after we agree on the names, of course. I propose: BOOST_COMEAU_CPP or BOOST_COMEAU_COMPILER BOOST_GNU_CPP or BOOST_GNU_COMPILER BOOST_INTEL_CPP or BOOST_INTEL_COMPILER BOOST_MSVC (well, this is a bit inconsistent :( Ideas?) -- Genny.

On Fri, 19 Mar 2004 15:46:36 +0100, Gennaro Prota <gennaro_prota@yahoo.com> wrote:
<debatable> At the cost of duplicating the definition, maybe it would be clearer to do:
Oops, sorry, ignore this please. I thought it only concerned VC6. But I still ask if it shouldn't test for BOOST_MSVC (<=1300). -- Genny.

Sounds like it's close enough, it might fail for people with VC6 + Intel and an updated Dinkum library,
Why?
Because although the library version number will be updated, it will still be a broken library (because Dinkumware ship libraries that are preconfigured to a particular compiler).
but that'll just have to be too bad, changes in mainline cvs now.
Thanks. Now, pardon me if I have other questions (all concerning the part that follows the #if/#endif above):
- shouldn't the test for BOOST_STD_EXTENSION_NAMESPACE be based on the *library* version, rather than _MSC_VER?
- shouldn't BOOST_NO_STD_ITERATOR_TRAITS test for "real" VC6?
Same problem, it doesn't matter what the library version number is, because the Dinkum library is preconfigured for a particular compiler, it doesn't become un-broken just because we're using Intel, if was originally configured for VC6/7, then it will always be broken, period.
<debatable> At the cost of duplicating the definition, maybe it would be clearer to do:
#if defined(_CPPLIB_VER) && (_CPPLIB_VER >= 306) // full Dinkum
# if REAL_VC6 ... # define BOOST_NO_STD_ITERATOR_TRAITS // <--- # endif
#else // old Dinkum ... # define BOOST_NO_STD_ITERATOR_TRAITS // <--- #endif </debatable>
- The test for BOOST_NO_STD_LOCALE is really restrictive. Fortunately it only refers to the Dinkum lib shipping with VC7. However if many of our users use Intel C++ with that library then it might be worth to soften it, because it really prevents a lot of code to work. (Well, this is not really a question :))
Sure, but Intel was choking on anything that included <locale> (or even did any vaguely non-trivial stream io) - if you can verify that this has been fixed with Intel 8 (I'm sure it probably has), then lets add an Intel version check and re-enable this for Intel 8.
PS: I'm not one who claims that others do work that he could do. It's just that these issues are a bit delicate and I wanted to see with you if there's any problem I'm missing. After that, I could commit the changes for you, if you like. This also holds for the compiler identification macros, after we agree on the names, of course. I propose:
BOOST_COMEAU_CPP or BOOST_COMEAU_COMPILER BOOST_GNU_CPP or BOOST_GNU_COMPILER BOOST_INTEL_CPP or BOOST_INTEL_COMPILER
BOOST_MSVC (well, this is a bit inconsistent :( Ideas?)
Personally I prefer the BOOST_GNU_COMPILER versions, but we already have BOOST_INTEL_CXX_VERSION, so maybe BOOST_GCC_CXX_VERSION etc? Thanks, John.

On Sat, 20 Mar 2004 12:06:41 -0000, "John Maddock" <john@johnmaddock.co.uk> wrote:
Sounds like it's close enough, it might fail for people with VC6 + Intel and an updated Dinkum library,
Why?
Because although the library version number will be updated, it will still be a broken library (because Dinkumware ship libraries that are preconfigured to a particular compiler).
Ah! That's what I was missing, then. I thought the configuration was simply a matter of choosing the correct directories for the library files and disabling (just) the things, such as use_facet<T> etc., that couldn't be handled by the compiler.
[...]
- The test for BOOST_NO_STD_LOCALE is really restrictive. Fortunately it only refers to the Dinkum lib shipping with VC7. [...]
Sure, but Intel was choking on anything that included <locale> (or even did any vaguely non-trivial stream io) - if you can verify that this has been fixed with Intel 8 (I'm sure it probably has), then lets add an Intel version check and re-enable this for Intel 8.
Sorry, I can't, because I have no access to the VC7's Dinkum.
[...] BOOST_COMEAU_CPP or BOOST_COMEAU_COMPILER BOOST_GNU_CPP or BOOST_GNU_COMPILER BOOST_INTEL_CPP or BOOST_INTEL_COMPILER
BOOST_MSVC (well, this is a bit inconsistent :( Ideas?)
Personally I prefer the BOOST_GNU_COMPILER versions, but we already have BOOST_INTEL_CXX_VERSION, so maybe BOOST_GCC_CXX_VERSION etc?
My goal was to choose short names, as otherwise preprocessing lines easily become enormous (if nothing else, it's a boost guideline to not exceed 80 characters). Note that even things like: #if BOOST_MSVC >= 1200 are usually rewritten as #if defined(BOOST_MSVC) && BOOST_MSVC >= 1200 just because gcc warns about the first form when using -Wundef. And something like #if defined(BOOST_GCC_CXX_VERSION) && BOOST_GCC_CXX_VERSION >= 295 is already 66 characters. <thinking out loud> If it wasn't for the gcc warning above, there's another idea that could be explored, which would allow, for instance, writing: std::cout << "Compiler version is: " << BOOST_COMPILER_VERSION << '\n'; That is: you choose a numeric ID for each compiler (in practice #define BOOST_BORLAND 1 #define BOOST_COMEAU 2 #define BOOST_COMPAQ 3 etc..). That would be done once, in select_compiler_config. Then in each compiler specific header you define BOOST_COMPILER to the appropriate id. For instance, in gcc.hpp #define BOOST_COMPILER BOOST_GNU #define BOOST_COMPILER_VERSION ... Usage would be: #if (BOOST_COMPILER == BOOST_GNU) && (BOOST_COMPILER_VERSION == ...) but, as I said, we would have probably complaints from gcc users. The user could also derive something like: enum compilers { borland = BOOST_BORLAND, comeau = ... }; </thinking out loud> PS: For gcc I propose the following definition: #if defined(__GNUC_PATCHLEVEL__) # define <choose_a_name> ( __GNUC__ * 10000 \ + __GNUC_MINOR__ * 100 \ + __GNUC_PATCHLEVEL__ ) #else # define <choose_a_name> ( __GNUC__ * 10000 \ + __GNUC_MINOR__ * 100) #endif Thanks, Genny.

Sure, but Intel was choking on anything that included <locale> (or even did any vaguely non-trivial stream io) - if you can verify that this has been fixed with Intel 8 (I'm sure it probably has), then lets add an Intel version check and re-enable this for Intel 8.
Sorry, I can't, because I have no access to the VC7's Dinkum.
OK I'll look into it when I get a chance.
My goal was to choose short names, as otherwise preprocessing lines easily become enormous (if nothing else, it's a boost guideline to not exceed 80 characters). Note that even things like:
#if BOOST_MSVC >= 1200
are usually rewritten as
#if defined(BOOST_MSVC) && BOOST_MSVC >= 1200
just because gcc warns about the first form when using -Wundef. And something like
#if defined(BOOST_GCC_CXX_VERSION) && BOOST_GCC_CXX_VERSION >= 295
is already 66 characters.
I see where you're coming from, so how about just BOOST_GCC/BOOST_BORLAND/BOOST_INTEL etc, probably added on an "as needed" basis.
<thinking out loud>
If it wasn't for the gcc warning above, there's another idea that could be explored, which would allow, for instance, writing:
std::cout << "Compiler version is: " << BOOST_COMPILER_VERSION << '\n';
That is: you choose a numeric ID for each compiler (in practice
#define BOOST_BORLAND 1 #define BOOST_COMEAU 2 #define BOOST_COMPAQ 3
etc..). That would be done once, in select_compiler_config. Then in each compiler specific header you define BOOST_COMPILER to the appropriate id. For instance, in gcc.hpp
#define BOOST_COMPILER BOOST_GNU #define BOOST_COMPILER_VERSION ...
Usage would be:
#if (BOOST_COMPILER == BOOST_GNU) && (BOOST_COMPILER_VERSION == ...)
but, as I said, we would have probably complaints from gcc users. The user could also derive something like:
enum compilers { borland = BOOST_BORLAND, comeau = ... };
</thinking out loud>
Looks a little too complicated to me...
PS: For gcc I propose the following definition:
#if defined(__GNUC_PATCHLEVEL__) # define <choose_a_name> ( __GNUC__ * 10000 \ + __GNUC_MINOR__ * 100 \ + __GNUC_PATCHLEVEL__ ) #else # define <choose_a_name> ( __GNUC__ * 10000 \ + __GNUC_MINOR__ * 100) #endif
Yes, that looks about right. John.

On Mon, 22 Mar 2004 12:47:31 -0000, "John Maddock" <john@johnmaddock.co.uk> wrote:
Sorry, I can't, because I have no access to the VC7's Dinkum.
OK I'll look into it when I get a chance.
Yup, that has happened before I got a chance to read this, thanks :)
I see where you're coming from, so how about just BOOST_GCC/BOOST_BORLAND/BOOST_INTEL etc, probably added on an "as needed" basis.
Everything works for me, as long as it is brief and consistent. I'll post a separate message with the proposed names, just to be sure that everyone reads them (this thread has a quite specific subject - non Intel users could have simply skipped it). About consistency, since the other macros use the vendor name (Intel, Borland, etc.), maybe BOOST_GNU is better than BOOST_GCC.
[Having a numeric ID for each compiler...] Looks a little too complicated to me...
<Just for the sake of discussion> Well, it's not so complicated, really. Instead of having a different macro for each compiler, to be tested with the defined() operator, you have one macro, BOOST_COMPILER (always defined) whose *value* identifies the compiler (1 is Borland, 2 is Comeau, etc.) Genny.

- The test for BOOST_NO_STD_LOCALE is really restrictive. Fortunately it only refers to the Dinkum lib shipping with VC7. [...]
Sure, but Intel was choking on anything that included <locale> (or even did any vaguely non-trivial stream io) - if you can verify that this has been fixed with Intel 8 (I'm sure it probably has), then lets add an Intel version check and re-enable this for Intel 8.
Sorry, I can't, because I have no access to the VC7's Dinkum.
OK, checked and working with Intel 8. However I have discovered another good reason to use and rely upon -Qvc7.1 and -Qvc7 : without these not only does the Intel compiler set _MSC_VER to 1200, but it also disables things like ADL :-/ John.

On Mon, 22 Mar 2004 13:03:45 -0000, "John Maddock" <john@johnmaddock.co.uk> wrote:
OK, checked and working with Intel 8.
Thanks.
However I have discovered another good reason to use and rely upon -Qvc7.1 and -Qvc7 : without these not only does the Intel compiler set _MSC_VER to 1200, but it also disables things like ADL :-/
Intel C++ for Windows has always had ADL disabled by default. That was when it followed VC6. Now that Visual C++ has ADL, Intel enables it too, when you use -Qvc7.1, and keeps the old behavior when you don't. To enable it anyway use -Qoption,c,--arg_dep_lookup FWIW, I always use at least the following in my .cfg file: /Qms0 /Zc:wchar_t,forScope -Qoption,c,--arg_dep_lookup -Qoption,c,--alternative_tokens plus, when possible, /Za and -Qoption,c,--dep_name in the command line. If you have other things that can be useful... Collecting the switches that unleash the real beast living inside Intel C++ has become sort of a hobby of mine :) Genny.

"John Maddock" <john@johnmaddock.co.uk> wrote: // // As far as I can tell from Intels docs, all it's predefined macros are set to // the same values irrespective of whether it's been installed on top of VC6, // VC7, or VC7.1. // I wonder what Intel could do: the compiler can be integrated in more than one VS version on the same machine, that's why you can't speak about an "installation on" a particular version. So IMO, the only possibility for setting the _MSC_VER macro is interpreting the /QvcXX switches on the command line. I think that just the default value is wrong: it should be 1310 instead of 1200. What do you think? Stefan

// // As far as I can tell from Intels docs, all it's predefined macros are set to // the same values irrespective of whether it's been installed on top of VC6, // VC7, or VC7.1. //
I wonder what Intel could do: the compiler can be integrated in more than one VS version on the same machine, that's why you can't speak about an "installation on" a particular version.
That's the conclusion I've come to as well.
So IMO, the only possibility for setting the _MSC_VER macro is interpreting the /QvcXX switches on the command line.
Yep, and if you use the IDE integration, that switch gets added for you.
I think that just the default value is wrong: it should be 1310 instead of 1200.
What do you think?
Probably this is up to Intel to decide based on their customer base, it's a pity that the command line setup batch file doesn't somehow inject the necessary switch into the command line, but there doesn't seem to be any means of doing that either. John.

On Fri, 12 Mar 2004 18:39:30 +0100, Gennaro Prota <gennaro_prota@yahoo.com> wrote:
Intel C++ for Windows never stops surprising me with its Microsoft bugtibility conundrums. When you use /Qms0 (version 8.0) it defines _MSC_VER to be 1200, as if it emulated VC++6! This tricks up the code in config/stdlib/dinkumware.hpp to define
# define BOOST_NO_STD_USE_FACET # define BOOST_HAS_TWO_ARG_USE_FACET
However the two-arg version of use_facet is deprecated and marked as such with __declspec(deprecated). Attached is an obvious patch to fix the problem.
Thinking at it again, my patch by-passes BOOST_NO_STDC_NAMESPACE and BOOST_NO_EXCEPTION_STD_NAMESPACE too. Is that ok? If not, the fix would be: # if (defined(_MSC_VER) && (_MSC_VER < 1300)) && !defined(__BORLANDC__) # if BOOST_INTEL_CXX_VERSION < 800 // <--- # define BOOST_NO_STD_USE_FACET # define BOOST_HAS_TWO_ARG_USE_FACET # endif // C lib functions aren't in namespace std either: # define BOOST_NO_STDC_NAMESPACE // and nor is <exception> # define BOOST_NO_EXCEPTION_STD_NAMESPACE # endif Sorry if I didn't think to this before. -- Genny.
participants (4)
-
David Abrahams
-
Gennaro Prota
-
John Maddock
-
Stefan Slapeta