[Python-Dev] ssize_t branch merged (original) (raw)

"Martin v. Löwis" martin at v.loewis.de
Sun Feb 19 06:46:40 CET 2006


Travis E. Oliphant wrote:

Why not just

#if SIZEOFSIZET == 2 #define PYSSIZETMAX 0x7fff #elif SIZEOFSIZET == 4 #define PYSSIZETMAX 0x7fffffff #elif SIZEOFSIZET == 8 #define PYSSIZETMAX 0x7fffffffffffffff #elif SIZEOFSIZET == 16 #define PYSSIZETMAX 0x7fffffffffffffffffffffffffffffff #endif

That would not work: 0x7fffffffffffffff is not a valid integer literal. 0x7fffffffffffffffL might work, or 0x7fffffffffffffffLL, or 0x7fffffffffffffffi64. Which of these is correct depends on the compiler.

How to spell 128-bit integral constants, I don't know; it appears that MS foresees a i128 suffix for them.

Regards, Martin



More information about the Python-Dev mailing list