Ben Taylor <[EMAIL PROTECTED]> writes: > ---- Johannes Schindelin <[EMAIL PROTECTED]> wrote: >> Hi Ben, >> >> On Sat, 15 Sep 2007, Ben Taylor wrote: >> >> > +#ifdef __sun__ >> > +/* Have to define this for Solaris as ULONG_LONG_MAX is not defined >> > + anywhere. ULONG_MAX is correct only on _LP64 systems */ >> > +#define ULONG_LONG_MAX 18446744073709551615UL >> > +#endif >> > + >> >> These constants are always defined, right? So why not "#ifndef >> ULONG_LONG_MAX"? > > I fear I may not have explained this well. > > On the Solaris systems I have access to, I find no system include file > that defines "ULONG_LONG_MAX". > > There are defines for ULONG_MAX which is equivilent to the value that > ULONG_LONG_MAX is, but only when the system is being compiled on > an "_LP64" (ie x86_64) system. When the system is 32-bit, ULONG_MAX > defaults to a typical max value for a 32-bit unsigned int.
Your reference to ULONG_MAX is a red herring. ULONG_MAX is the limit for unsigned long, and ULONG_LONG_MAX is the limit for unsigned long long. If your compiler does not support the long long type then ULONG_LONG_MAX should not be defined either. Instead, vl.c should use UINT64_MAX. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."