Boost logo

Boost Users :

Subject: Re: [Boost-users] [integer]/cstdint.hpp How to use portableliterals?
From: Vicente Botet Escriba (vicente.botet_at_[hidden])
Date: 2009-12-10 16:53:12

Kim Barrett-2 wrote:
> On Dec 10, 2009, at 11:18 AM, John Maddock wrote:
>>> Compiler flag ;) gcc -D and in Project setting of VC ;)
>> Sure, but that doesn't work in a library header file where you have no
>> control over project settings...
>> I'm thinking that maybe we should change boost/cstdint.hpp to follow
>> C++0x and always define these macros, any objections or problems if we do
>> that?
> This isn't a general solution. Consider
> #include <something which includes stdint.h>
> #include <boost/cstdint.hpp>
> Documenting a required compiler flag is really the better solution, in my
> opinion.
> That, and perhaps some utility macros to help library developers detect
> and report misconfiguration in a way that might direct users toward a
> solution.

I don't see any problem in the above code. Just boost/cstdint.hpp need to
define INTMAX_C even if not defined by the preceding inclusion of #include
<something which includes stdint.h>.

As Howard has been signaled, C++0x <cstdint> will define INTMAX_C
independently of __STDC_CONSTANT_MACROS is defined or not.


View this message in context:
Sent from the Boost - Users mailing list archive at

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at