[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to find out if an architecture is 32 or 64 bit?



Hello !
On Wed, Mar 14, 2001 at 09:59:06AM +0100, T. Weyergraf wrote:
<snip> 
> If the information is needed at compile-time, check unistd.h, were
> _XBS_LP64_OFF64 is set.  The relevant includes are:
> 
> bits/posix_opt.h, bits/environments.h and bits/wordsize.h
unistd.h exists on our OSF1 machine while the other three files don't.

I cannot find the string "_XBS_LP64_OFF64" in this file however.


> The selection, which programming model is used, is controlled there
> in a fairly detailed manner, which has the advantage of being "The
> POSIX Way(TM)", and therefore even portable outside the Linux world
> ( can anybody with access to a True64 System check this claim ? I
> would be interested...  )
I am not a C programmer so I might missed something but it appears
different to me. Let me know if there is something special I should
look for.

> 
> Depending on what specific aspects of the machine's wordsize you
> need, you can go as straight as checking if __WORDSIZE is set to 32
> or 64, or as controlled as checking if _XBS5_LP64_OFF64 provides a
> 64-bit pointer environment.
<snip>

Regards

        Helge
-- 
Helge Kreutzmann, Dipl.-Phys.                      kreutzm@itp.uni-hannover.de
         For gpg-key: finger kreutzm@rigel.itp.uni-hannover.de
    64bit GNU powered                  http://www.itp.uni-hannover.de/~kreutzm
       Help keep free software "libre": http://www.freepatents.org/



Reply to: