[Python-Dev] Solaris family and 64 bits compiling

"Martin v. Löwis" martin at v.loewis.de
Tue Nov 23 01:12:16 CET 2010


Am 23.11.2010 00:48, schrieb Jesus Cea:
> I think this is probably trivial, but is there any foolproof way to
> detect 64 bit builds in python, beside "sys.maxint"?.

The canonical way is to use platform.architecture().

> And any macro useable for conditional compilation in C?.

You need to be more specific than that. There are perhaps ten
independent properties you may query, depending on what precise problem
you try to solve. Most likely, you are looking for SIZEOF_VOID_P
(but don't use that unless you literally want to know how many bytes
a pointer uses, or whether it uses 4 or 8 bytes).

Regards,
Martin


More information about the Python-Dev mailing list