From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IWx63-0007ol-AI for qemu-devel@nongnu.org; Sun, 16 Sep 2007 12:35:47 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IWx60-0007lT-QU for qemu-devel@nongnu.org; Sun, 16 Sep 2007 12:35:46 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IWx60-0007lQ-Jk for qemu-devel@nongnu.org; Sun, 16 Sep 2007 12:35:44 -0400 Received: from ns.suse.de ([195.135.220.2] helo=mx1.suse.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IWx60-0005LC-7d for qemu-devel@nongnu.org; Sun, 16 Sep 2007 12:35:44 -0400 From: Andreas Schwab Subject: Re: [Qemu-devel] Comment for Solaris fix for the HPTC References: <26700091.1189955481400.JavaMail.root@eastrmwml11> Date: Sun, 16 Sep 2007 18:35:38 +0200 In-Reply-To: <26700091.1189955481400.JavaMail.root@eastrmwml11> (Ben Taylor's message of "Sun\, 16 Sep 2007 11\:11\:21 -0400") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: sol10x86@cox.net Cc: qemu-devel@nongnu.org Ben Taylor writes: > ---- Johannes Schindelin wrote:=20 >> Hi Ben, >>=20 >> On Sat, 15 Sep 2007, Ben Taylor wrote: >>=20 >> > +#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 >> > + >>=20 >> These constants are always defined, right? So why not "#ifndef=20 >> 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. --=20 Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstra=DFe 5, 90409 N=FCrnberg, Germany PGP key fingerprint =3D 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED= 5 "And now for something completely different."