From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2002-10-01 03:40:38


Björn Karlsson wrote:
>
> > From: Markus Schöpflin [mailto:markus.schoepflin_at_[hidden]]
> >
> > I don't get this one. Let's analyse the macro as proposed.
> >
> > #if (defined(_MSC_VER) && (_MSC_VER <= 1300)) // true for MSVC <=7.0
> > && (!defined(_CPPLIB_VER) // true if _CPPLIB_VER not defined
> > || (_CPPLIB_VER < 306)) // true if _CPPLIB_VER < 306
> >
> > This means the macro evaluates to true iff the compiler is MSVC <= 7.0
> > AND the is no dinkumware lib or it's version is less than 306.
> >
> > Did I make a mistake, here?
> >
>
> Changing the above to this:
> #if (defined(_MSC_VER) && (_MSC_VER <= 1300)) && (defined(_CPPLIB_VER) &&
> (_CPPLIB_VER < 306)) // Dinkumware for VC6/7
>
> yields a test that evaluates to true when running MSVC<=7 with a Dinkumware
> lib (version less than 306). As you say, your version also evaluates to true
> on MSVC<=7 when there's no Dinkumware lib present; which probably isn't the
> intent.

It's even more complicated than that. :-)

You can't check for Dinkumware lib with MSVC6 because it doesn't define
_CPPLIB_VER. This macro is only defined in later version of the Dinkumware
library. I think that's why there was a test for !defined(_CPPLIB_VER).

My version was wrong for MSVC running another version of the standard
library like STLport.

AFAIK, your version only fails for the library delivered with MSVC6 but
I can't guarantee this.

The config system already does all the hard work for us, why don't why add
some makro to it?

Markus