Boost logo

Boost :

From: Ulrich Eckhardt (doomster_at_[hidden])
Date: 2006-07-16 08:51:08


On Saturday 08 July 2006 20:58, Gennaro Prota wrote:
> I've just committed a prefix file with the new macro names that will
> be used for compiler identification:
>
>
> http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?BoostConfig

  // Microsoft Visual C++
  #ifndef BOOST_CXX_MSVC
  #define BOOST_CXX_MSVC 0
  #endif

I'm against that. The point is that Visual C++ is a product name which
includes a compiler. However, MS include their compiler into other products,
too, e.g. an SDK to cross-compile for 64 bit, the (discontinued/merged, but
still used) embedded Visual Studios or Platform Builder. If the above macro
is used like it sometimes is, it further blurs the difference between the
compiler, the standardlibrary and the available OS API (i.e. the SDK). In my
experience this leads to people meaning one thing but creating a preprocessor
check for something that is only related.

BTW: in case anyone wonders, in my experience the MS compilers are 99%
bug-to-bug compatible, no matter if they target the desktop win32 or any of
the CE targets. I don't have any experience with the 64 bit targets, though,
but what I heard is that they mostly behave the same.

I'd suggest either *_MS or *_MICROSOFT, including a list of products saying
which compiler versions are included there to help the ensuing initial
confusion, here's the ones I know about:

MSC12:
 - VC6 (Visual C++ 6)
 - eVC4
 - eVC3(?, probably obsolete)
 - Platform Builder 4.2
MSC13.0:
 - VC7 (Visual Studio .Net 2002?)
MSC13.10:
 - VC7.1 (Visual Studio .Net 2003?)
 - Platform Builder 5(?)
MSC14:
 - VC8 (Visual Studio .Net 2005)

> One other issue:
>
> suppose a compiler defines M=0xMMmmpp to indicate version MM.mm.pp (a
> common case).

... which is a stupidity that makes people think that the version following
1.9 is 2.0. Should Boost support this half-knowledge? Or do you mean that the
version number uses some kind of decimal in hex encoding?

> Let's take 0x030411 as an example. Now, since we want
> the user to be able to write:
>
> #if BOOST_CXX_FOO == BOOST_VERSION_NUMBER(3, 4, 11) // (a)

I'd prefer not to write this, because how would you express a different
relationship than equality? Sometimes you simply want to say 'if major=2'
or 'if major=3 and minor>2', so I'd rather need BOOST_CXX_FOO_MAJOR etc.

I don't know if this discussion already took place and the rationale is
somewhere else which I didn't look for, so I'll accept if you tell me that
it's correct, but this just struck me as odd. Sorry for the noise in that
case.

Uli


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