[Pythonmac-SIG] wxPython build issue

Kevin Ollivier kevino at theolliviers.com
Sat Feb 4 01:08:17 CET 2006


Hi Bill,

On Feb 3, 2006, at 12:13 PM, Bill Northcott wrote:

> On 04/02/2006, at 3:52 AM, Kevin Ollivier wrote:
>>> So I added more alternative conditions to wx/string.h:46 thus:
>>> #if defined(HAVE_STRCASECMP_IN_STRINGS_H) || _POSIX_C_SOURCE ==  
>>> 200112L || _XOPEN_SOURCE == 600
>>>
>>> This definitely works on MacOS X 10.4 and I don't see how it can  
>>> break on other systems.
>>
>> Out of curiosity, was there a problem with just doing defined 
>> (_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) tests? Are these  
>> always guaranteed to be set to those values?
>
> As I read the Opengroup document, Posix 200112L and Xopen 600 have  
> been converged.  Older standards would not be the same and  
> certainly older versions of Xopen might have strcasecmp and friends  
> in string.h.  OTOH higher versions are undefined.  So it would not  
> be right to assume the code should work under them.  That was my  
> take but it may be quite wrong.

My concern is that while you're right that we can't assume that the  
code should work for new versions, neither can we assume it won't, so  
I'd prefer a solution that is guaranteed to work even if these values  
change. IMHO, even if we need to write a OS X-only configure test to  
properly set HAVE_STRCASECMP_IN_STRING_H, I'd rather go that route,  
because strings.h handles both scenarios (with or without the define)  
correctly and likely will continue to do so in the future.

Thanks,

Kevin


More information about the Pythonmac-SIG mailing list