Skip to content

Commit 8c579a3

Browse files
author
Kristján Valur Jónsson
committed
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.
1 parent 3633892 commit 8c579a3

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

Modules/posixmodule.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,9 @@ _pystat_fromstructstat(STRUCT_STAT *st)
12271227

12281228
#define ISSLASHA(c) ((c) == '\\' || (c) == '/')
12291229
#define ISSLASHW(c) ((c) == L'\\' || (c) == L'/')
1230+
#ifndef ARRAYSIZE
12301231
#define ARRAYSIZE(a) (sizeof(a) / sizeof(a[0]))
1232+
#endif
12311233

12321234
static BOOL
12331235
IsUNCRootA(char *path, int pathlen)

PC/pyconfig.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ typedef int pid_t;
164164
#define Py_IS_INFINITY(X) (!_finite(X) && !_isnan(X))
165165
#define Py_IS_FINITE(X) _finite(X)
166166

167+
/* Turn off warnings about deprecated C runtime functions in
168+
VisualStudio .NET 2005 */
169+
#if _MSC_VER >= 1400 && !defined _CRT_SECURE_NO_DEPRECATE
170+
#define _CRT_SECURE_NO_DEPRECATE
171+
#endif
172+
167173
#endif /* _MSC_VER */
168174

169175
/* define some ANSI types that are not defined in earlier Win headers */

0 commit comments

Comments
 (0)