Boost logo

Boost :

From: Chris Little (cslittle_at_[hidden])
Date: 2002-11-30 16:37:04

on 11/25/02 4:54 AM, Rozental, Gennadiy at gennadiy.rozental_at_[hidden] wrote:

>> Dear Gennadiy,
>> I've just been trying out the latest (1.29.0) release of the Boost >
> Unit Test Framework. I ran into a few minor localisation hiccups you
>> might want to be told about.
>> I'm using Metrowerks Codewarrior 8.1 on MacOS 9.2. A couple of
>> problems resulted directly from this.
>> 1) At line 45 of execution_monitor.cpp the test
>> #if defined(_MSC_VER) || (defined(__MWERKS__) && __MWERKS__ >= 0x3000)
>> yielded a false positive. I altered it to
>> #if defined(_MSC_VER) || (defined(__MWERKS__) && defined(__INTEL__) &&
>> __MWERKS__ >= 0x3000)
> Could Metrowerks users conferm that this is the best way to separate Mac and
> everything else?

This is fine.

>> 2) In cstdint.hpp importing the C99 typedefs failed. When compiled as >
> C++,
>> the MW version of <stdint.h> behaves by analogy with the other standard
>> headers: it defines the typedefs in std:: and then exports them to the
>> global namespace with using declarations. Unfortunately, this seems to
>> mean that when cstdint.hpp tries to import them from the global
>> namespace, they aren't really there. I've hacked a copy of
>> cstdint.hpp to work by just sticking std:: in where needed, but
>> something more robust needs to be done here.
> Could this author reply to this?

I wrote an email back in February about this but got busy and forgot about
it. For some strange reason the email isn't in the ASPN archive so I've
included it here.

> I have been looking at Jeff Garland's Gregorian Date/Time Library and I am
> having difficult using it with Metrowerks CWP 7.2.
> I have had an email discussion with Jeff and he has fixed the minor issues but
> the final sticking point is how boost/cstdint.hpp interacts with the cstdint
> provided by Metrowerks.
> Currently boost/cstdint.hpp is structured to act like two header files in one.
> The first block defines the C numeric types (by including stdint.h or direct
> definition) and then imports the types into the boost namespace.
> The second block defines INTn_C, UINTn_C, ... if requested and the compiler
> doesn't provide support natively.
> My problem arises because Metrowerks is configured to provide all of the
> support. I.e. That boost/cstdint.h really only includes stdint.h which
> includes cstdint and then imports the types into the boost namespace.
> If I have a header files that has
> #include <boost/cstdint.hpp>
> And later in another header file I have
> #include <boost/cstdint.hpp>
> The INTn_C macros are not defined because the include of stdint.h inside
> boost/cstdint.hpp is inside the include guards for the first block.
> For platforms that do not provide the INTn_C macros the boost model works fine
> because of the two blocks inside the single header file.
> I'm not sure how to fix this. I'm thinking that what I need is a new config
> flag like BOOST_HAS_CONFORMING_CSTDINT and that boost/cstdint.hpp would look
> something like
> #include <boost/config.hpp>
> #include <cstdint>
> #include <climits>
> Namespace boost
> {
> Import types
> }
> #else
> ... Existing boost/cstdint.hpp ...
> #endif
> Notice the lack of include guards around the whole file because we need to
> force cstdint to be included each time because someone may have defined
> __STDC_CONSTANT_MACROS be including boost/cstdint.hpp.

I was using CWP7 when this was written but the same applies to CWP8. In
fact CWP8 has its cstdint header restructured to follow the two headers in
model to support __STDC_CONSTANT_MACROS .

If I've followed the cvs log correctly then it looks like John Maddock is
the author of the C99 macros so it looks like he is the person we need
feedback from.


Boost list run by bdawes at, gregod at, cpdaniel at, john at