Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2004-03-22 07:47:31


> >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.


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