> -----Original Message----- > From: "Martin v. Löwis" [mailto:[EMAIL PROTECTED] > Sent: Tuesday, November 21, 2006 12:22 PM > To: Julian > Cc: python-dev@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. _______________________________________________ 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