"Martin v. Löwis" <[EMAIL PROTECTED]> 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
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to