ULong64_t interpreted as 32bit long on 32bit machine

Hello,

I got report that the compilation of my code containing:
const ULong64_t kMask0 = 0x0000ffff0000ffff;
const ULong64_t kMask1 = 0xffff0000ffff0000;

fails on 32 bit machine with message:
STEER/AliMultiplicity.cxx:371: error: integer constant is too large for
"long" type
STEER/AliMultiplicity.cxx:372: error: integer constant is too large for
"long" type
Acording to Rtypes.h ULong64_t should be ported to 32 bit machine as
’long long’. Any hint where is the problem?

The system is:
Scientific Linux SL release 4.5 (Beryllium)
gcc: gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-8)

root: v5-26-00b

On 64bit systems it works w/o problems.

Best regards,
Ruben

Where do you put this constant in, you can only assign it to another 64 bit variable. On a 64-bit platform a Long_t will be accepted because it is also 64-bit long, but not on a 32-bit platform.

Cheers, Fons.

Thanks Fons,
the compilation fails right on the declaration of the const ULong64_t (L371,372):

alisoft.cern.ch/viewvc/trunk/STE … ot=AliRoot

Cheers,
Ruben

Try:

  const ULong64_t kMask0 = 0x0000ffff0000ffffLL;
  const ULong64_t kMask1 = 0xffff0000ffff0000LL;

– Fons

Thanks Fons,
It worked!
Cheers,
Ruben