Detecting 64bit vs. 32bit Linux
Lawrence D'Oliveiro
ldo at geek-central.gen.new_zealand
Tue Jul 11 03:39:18 EDT 2006
In article <mailman.7974.1152537684.27775.python-list at python.org>,
Robin Becker <robin at reportlab.com> wrote:
>Michael Yanowitz wrote:
>......
>>
>>> I need to detect whether the operating system I am running on (not the
>>> Python version) is 64bit or 32bit. One requirement is that I need to
>>> include support for non-Intel/AMD architectures.
>>
>> The standard C way would be to check sizeof(void *).
>so on those old ARM RISC OSes with 32 bit arithmetic would I get sizeof(void
>*)
>== 4 when the address bus was 26 bits wide?
And the original 68000-based Macs where you would get the same
sizeof(void *), but the address bus was only 24 bits wide. Nevertheless,
you were supposed to pretend that addresses were a full 32 bits in size.
The programs that didn't got into trouble later.
More information about the Python-list
mailing list