Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 07 Sep 2007 10:39:15 +0800
From:      Erich Dollansky <oceanare@pacific.net.sg>
To:        Luigi Rizzo <rizzo@icir.org>
Cc:        Yan <rottled@gmail.com>, current@freebsd.org
Subject:   Re: how to tell 64 vs 32 bit architecture ?
Message-ID:  <46E0B9D3.8000505@pacific.net.sg>
In-Reply-To: <20070906125439.A84696@xorpc.icir.org>
References:  <20070906111028.A83649@xorpc.icir.org>	<54b90fdf0709061225q48af11c2yca8d330eff514159@mail.gmail.com> <20070906125439.A84696@xorpc.icir.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

Erich



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?46E0B9D3.8000505>