Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2006-12-01 14:11:15


Kim Barrett wrote:
> At 2:09 PM +0000 12/1/06, John Maddock wrote:
>> I did have to add "uLL" to the end of the 64-bit constants though to
>> get it to compile with gcc-3.4.4 on Linux/Xeon.
>>
>> This is a tricky one because you need uLL if uint64_t is a long long
>> and ui64 if it's a MSVC++ specific unsigned __int64.
>
> The C99 macro UINT64_C(value) might be helpful here.

Indeed and we have one in boost/cstdint.hpp, but it's less useful than it
first appears, because:

If we are forwarding to the "native" stdint.h and someone else has already
included stdint.h by the time we include it with __STDC_CONSTANT_MACROS
defined, then the chances are that UINT64_C will *not be defined*. Our own
version does the right thing with multiple includes, but most (all?) the
native versions do not :-(

John.


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