[Python-Dev] Suggestion/ feature request (original) (raw)

Julian julvar at tamu.edu
Tue Nov 21 20:13:09 CET 2006


-----Original Message----- From: "Martin v. Löwis" [mailto:martin at v.loewis.de] Sent: Tuesday, November 21, 2006 12:22 PM To: Julian Cc: python-dev at python.org Subject: Re: [Python-Dev] Suggestion/ feature request

Julian schrieb: > SWIG seems to have done it properly by checking to see if it has been > defined already (which, I think, is how python should do it as well) > Now, even if I am not using SWIG, I could imagine these being defined > elsewhere (by other headers/libraries) or even by setting them in the > VS2005 IDE project settings (which I actually do sometimes). While > these are just warnings and not errors, it would look cleaner if > pyconfig.h would check if they were defined already. Sure; I have fixed this now in r52817 and r52818 I just wondered why you get the warning: you shouldn't get one if the redefinition is the same as the original one. In this case, it wasn't the same redefinition, as SWIG was merely defining them, and Python was defining them to 1. Regards, Martin

Thanks! you are right... I didn't know that ! I have two questions though... Is there any reason why Python is defining them to 1? In pyconfig.h, there is:

#ifndef _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE 1 #endif

And then later on in the same file: /* Turn off warnings about deprecated C runtime functions in VisualStudio .NET 2005 */ #if _MSC_VER >= 1400 && !defined _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE #endif

Isn't that redundant? I don't think that second block will ever get executed. Moreover, in the second block, it is not being defined to 1. why is that ?

Julian.



More information about the Python-Dev mailing list