"Martin v. Löwis" <martin at v.loewis.de> writes: > David Abrahams schrieb: >> #if PY_VERSION_HEX < 0x02050000 >> typedef int Py_ssize_t; >> #define PY_SSIZE_T_MAX INT_MAX >> #define PY_SSIZE_T_MIN INT_MIN >> #endif >> >> I just wanted to point out that this advice could lead to library >> header collisions when multiple 3rd parties decide to follow it. I >> suggest it be changed to something like: >> >> #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) > > Strictly speaking, this shouldn't be necessary. C allows redefinition > of an object-like macro if the replacement list is identical (for > some definition of identical which applies if the fragment is > copied literally from the PEP). > > So I assume you had non-identical replacement list? No: a. I didn't actually experience a collision; I only anticipated it b. We were using C++, which IIRC does not allow such redefinition c. anyway you'll get a nasty warning, which for some people will be just as bad as an error > Can you share what alternative definition you were using? > > In any case, I still think this is good practice, so I added it > to the PEP. Thanks, -- Dave Abrahams Boost Consulting www.boost-consulting.com
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