Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2004-03-20 11:53:55


On Sat, 20 Mar 2004 12:06:41 -0000, "John Maddock"
<john_at_[hidden]> 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.


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