Boost logo

Boost :

From: Valentin Bonnard (Bonnard.V_at_[hidden])
Date: 2000-08-03 10:36:27


Daryle Walker wrote:
>
> on 8/1/00 7:32 PM, Valentin Bonnard at Bonnard.V_at_[hidden] wrote:
>
> > Daryle Walker wrote:
> >
> >> I think there is another file that checks for that macro constant or for
> >> another one, but maybe ULLONG_MAX is the standard C99 name and the other is
> >> pre-C99 variant for a specific compiler.
> >
> > ULLONG_MAX is indeed the C99 constant for std::numeric_limits<unsigned long
> > long>::max ()
>
> Should we use this for an indicator for (unsigned) long long then? Or
> should we add a #define-d flag in config.hpp anyway? BTW, the Boost file
> with a nonstandard check was integer_traits.hpp, where it checks for
> ULONG_LONG_MAX if ULLONG_MAX fails.

fuste-/tmp $ cat > longlong.c
#include <limits.h>

int main()
{
  ULLONG_MAX;
  ULONG_LONG_MAX;
  return 0;
}
fuste-/tmp $ gcc longlong.c
fuste-/tmp $ gcc -ansi longlong.c
longlong.c: In function `main':
longlong.c:5: `ULLONG_MAX' undeclared (first use in this function)
longlong.c:5: (Each undeclared identifier is reported only once
longlong.c:5: for each function it appears in.)
longlong.c:6: `ULONG_LONG_MAX' undeclared (first use in this function)
fuste-/tmp $

So it appears that gcc defines both (or neither in conforming mode).
I would only check for the official name one unless there are compilers
out there which implemented long long before it was standard C99
and use the wrong macro name.

PS: you don't need to send me the email twice: I am reading the boost ML
!

-- 
Valentin Bonnard

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