[Python-checkins] r46778 - in python/trunk: Modules/posixmodule.c PC/pyconfig.h

kristjan.jonsson python-checkins at python.org
Fri Jun 9 18:28:03 CEST 2006


Author: kristjan.jonsson
Date: Fri Jun  9 18:28:01 2006
New Revision: 46778

Modified:
   python/trunk/Modules/posixmodule.c
   python/trunk/PC/pyconfig.h
Log:
Turn off warning about deprecated CRT functions on for VisualStudio .NET 2005.
Make the definition #ARRAYSIZE conditional.  VisualStudio .NET 2005 already has it defined using a better gimmick.

Modified: python/trunk/Modules/posixmodule.c
==============================================================================
--- python/trunk/Modules/posixmodule.c	(original)
+++ python/trunk/Modules/posixmodule.c	Fri Jun  9 18:28:01 2006
@@ -1227,7 +1227,9 @@
 
 #define ISSLASHA(c) ((c) == '\\' || (c) == '/')
 #define ISSLASHW(c) ((c) == L'\\' || (c) == L'/')
+#ifndef ARRAYSIZE
 #define ARRAYSIZE(a) (sizeof(a) / sizeof(a[0]))
+#endif
 
 static BOOL
 IsUNCRootA(char *path, int pathlen)

Modified: python/trunk/PC/pyconfig.h
==============================================================================
--- python/trunk/PC/pyconfig.h	(original)
+++ python/trunk/PC/pyconfig.h	Fri Jun  9 18:28:01 2006
@@ -164,6 +164,12 @@
 #define Py_IS_INFINITY(X) (!_finite(X) && !_isnan(X))
 #define Py_IS_FINITE(X) _finite(X)
 
+/* 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
+
 #endif /* _MSC_VER */
 
 /* define some ANSI types that are not defined in earlier Win headers */


More information about the Python-checkins mailing list