From owner-freebsd-current@FreeBSD.ORG Fri Sep 7 06:33:08 2007 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA2FE16A418 for ; Fri, 7 Sep 2007 06:33:08 +0000 (UTC) (envelope-from brucec@muon.bluestop.org) Received: from muon.bluestop.org (muon.bluestop.org [80.68.94.188]) by mx1.freebsd.org (Postfix) with ESMTP id A0B3813C468 for ; Fri, 7 Sep 2007 06:33:08 +0000 (UTC) (envelope-from brucec@muon.bluestop.org) Received: by muon.bluestop.org (Postfix, from userid 1000) id BF7A33010B; Fri, 7 Sep 2007 07:28:59 +0100 (BST) Date: Fri, 7 Sep 2007 07:28:59 +0100 From: bruce@cran.org.uk To: Erich Dollansky Message-ID: <20070907062859.GA15310@muon.bluestop.org> References: <20070906111028.A83649@xorpc.icir.org> <54b90fdf0709061225q48af11c2yca8d330eff514159@mail.gmail.com> <20070906125439.A84696@xorpc.icir.org> <46E0B9D3.8000505@pacific.net.sg> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46E0B9D3.8000505@pacific.net.sg> User-Agent: Mutt/1.5.13 (2006-08-11) Cc: Luigi Rizzo , Yan , current@freebsd.org Subject: Re: how to tell 64 vs 32 bit architecture ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2007 06:33:08 -0000 On Fri, Sep 07, 2007 at 10:39:15AM +0800, Erich Dollansky wrote: > Hi, > > I have not found a method yet whic works 100% and is portable. > > Luigi Rizzo wrote: > >On Thu, Sep 06, 2007 at 03:25:52PM -0400, Yan wrote: > > Consider this: > > >>Perhaps "if(sizeof(void*)==4) { /* 32 */} else if(sizeof(void*) ==8) { /* > >>64 > >>*/ }" ? > >> > and also > > sizeof (int) > > The rest will be platform specific. > An int usually remains as 4 bytes on 64-bit platforms; long changes to 64-bit. -- Bruce Cran