how to tell 64 vs 32 bit architecture ?

Erich Dollansky oceanare at pacific.net.sg
Thu Sep 6 20:07:28 PDT 2007


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


More information about the freebsd-current mailing list