From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=33895 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P5g35-0004p3-BH for qemu-devel@nongnu.org; Tue, 12 Oct 2010 10:41:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P5g34-0005j7-6H for qemu-devel@nongnu.org; Tue, 12 Oct 2010 10:41:51 -0400 Received: from fe01x03-cgp.akado.ru ([77.232.31.164]:59608 helo=akado.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P5g33-0005io-Vy for qemu-devel@nongnu.org; Tue, 12 Oct 2010 10:41:50 -0400 Date: Tue, 12 Oct 2010 18:41:44 +0400 (MSD) From: malc Subject: Re: [Qemu-devel] [PATCH 08/39] provide portable sizeof(long) test In-Reply-To: <4CB47348.1050700@redhat.com> Message-ID: References: <1286888457-5033-1-git-send-email-pbonzini@redhat.com> <1286888457-5033-9-git-send-email-pbonzini@redhat.com> <4CB47129.1090202@redhat.com> <4CB47348.1050700@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On Tue, 12 Oct 2010, Paolo Bonzini wrote: > On 10/12/2010 04:38 PM, malc wrote: > > On Tue, 12 Oct 2010, Paolo Bonzini wrote: > > > > > On 10/12/2010 03:47 PM, malc wrote: > > > > > # host long bits test > > > > > -hostlongbits="32" > > > > > -case "$cpu" in > > > > > - x86_64|alpha|ia64|sparc64|ppc64|s390x) > > > > > - hostlongbits=64 > > > > > - ;; > > > > > -esac > > > > > +cat> $TMPC<< EOF > > > > > +int sizeof_long_is_8[sizeof(long) == 8 ? 1 : -1]; > > > > > +EOF > > > > > +if compile_object; then > > > > > +hostlongbits=64 > > > > > +else > > > > > +hostlongbits=32 > > > > > +fi > > > > > > > > This is wrong. > > > > > > Care to expand? > > > > Gives wrong results on Win64. > > Then it's not HOST_LONG_BITS, it's HOST_POINTER_BITS. Not quite, [s]size_t/ptrdiff_t are 64 bits wide udner Win64, little to do with pointers. > > Paolo > -- mailto:av1474@comtv.ru