A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-February/061391.html below:

[Python-Dev] ssize_t branch merged

[Python-Dev] ssize_t branch merged [Python-Dev] ssize_t branch mergedTravis E. Oliphant oliphant.travis at ieee.org
Sun Feb 19 00:16:02 CET 2006
Martin v. Löwis wrote:
> Neal Norwitz wrote:
> 
>>I suppose that might be nice, but would require configure magic.  I'm
>>not sure how it could be done on Windows.
> 
> 
> Contributions are welcome. On Windows, it can be hard-coded.
> 
> Actually, something like
> 
> #if SIZEOF_SIZE_T == SIZEOF_INT
> #define PY_SSIZE_T_MAX INT_MAX
> #elif SIZEOF_SIZE_T == SIZEOF_LONG
> #define PY_SSIZE_T_MAX LONG_MAX
> #else
> #error What is size_t equal to?
> #endif
> 
> might work.


Why not just

#if SIZEOF_SIZE_T == 2
#define PY_SSIZE_T_MAX 0x7fff
#elif SIZEOF_SIZE_T == 4
#define PY_SSIZE_T_MAX 0x7fffffff
#elif SIZEOF_SIZE_T == 8
#define PY_SSIZE_T_MAX 0x7fffffffffffffff
#elif SIZEOF_SIZE_T == 16
#define PY_SSIZE_T_MAX 0x7fffffffffffffffffffffffffffffff
#endif

?

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4