Date: Fri, 7 Sep 2007 07:28:59 +0100 From: bruce@cran.org.uk To: Erich Dollansky <oceanare@pacific.net.sg> Cc: Luigi Rizzo <rizzo@icir.org>, Yan <rottled@gmail.com>, current@freebsd.org Subject: Re: how to tell 64 vs 32 bit architecture ? Message-ID: <20070907062859.GA15310@muon.bluestop.org> In-Reply-To: <46E0B9D3.8000505@pacific.net.sg> References: <20070906111028.A83649@xorpc.icir.org> <54b90fdf0709061225q48af11c2yca8d330eff514159@mail.gmail.com> <20070906125439.A84696@xorpc.icir.org> <46E0B9D3.8000505@pacific.net.sg>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070907062859.GA15310>