]> granicus.if.org Git - python/commitdiff
Turn off warning about deprecated CRT functions on for VisualStudio .NET 2005.
authorKristján Valur Jónsson <kristjan@ccpgames.com>
Fri, 9 Jun 2006 16:28:01 +0000 (16:28 +0000)
committerKristján Valur Jónsson <kristjan@ccpgames.com>
Fri, 9 Jun 2006 16:28:01 +0000 (16:28 +0000)
Make the definition #ARRAYSIZE conditional.  VisualStudio .NET 2005 already has it defined using a better gimmick.

Modules/posixmodule.c
PC/pyconfig.h

index c0280de81e7f647192ec17d0a948d3c4f4dae769..12e1c837005a651dbbdea02ad0191960a6931752 100644 (file)
@@ -1227,7 +1227,9 @@ _pystat_fromstructstat(STRUCT_STAT *st)
 
 #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)
index cb42131d4f06a05efa49a54f5aa6cfd7c3cdc5be..14a32dbbb1d497c64ad61ba8eb19a4dd878082af 100644 (file)
@@ -164,6 +164,12 @@ typedef int pid_t;
 #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 */