From dee3844f130994f720588cdac9931e202d252641 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 7 Nov 2007 18:18:42 +0000 Subject: [PATCH] MSVC versions prior to VS2005 do not complain about portable C functions --- ares/config-win32.h | 10 ++++++++++ lib/config-win32.h | 10 ++++++---- lib/config-win32ce.h | 10 ++++++---- src/config-win32.h | 10 ++++++---- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/ares/config-win32.h b/ares/config-win32.h index 94ffe5389..1b65ce764 100644 --- a/ares/config-win32.h +++ b/ares/config-win32.h @@ -159,6 +159,16 @@ /* Define this if you have struct timeval */ #define HAVE_STRUCT_TIMEVAL 1 +/* ---------------------------------------------------------------- */ +/* COMPILER SPECIFIC */ +/* ---------------------------------------------------------------- */ + +/* Define to avoid VS2005 complaining about portable C functions */ +#if defined(_MSC_VER) && (_MSC_VER >= 1400) +#define _CRT_SECURE_NO_DEPRECATE 1 +#define _CRT_NONSTDC_NO_DEPRECATE 1 +#endif + /* ---------------------------------------------------------------- */ /* IPV6 COMPATIBILITY */ /* ---------------------------------------------------------------- */ diff --git a/lib/config-win32.h b/lib/config-win32.h index 6102f9386..97db859b9 100644 --- a/lib/config-win32.h +++ b/lib/config-win32.h @@ -347,6 +347,12 @@ #define HAVE_LONGLONG 1 #endif +/* Define to avoid VS2005 complaining about portable C functions */ +#if defined(_MSC_VER) && (_MSC_VER >= 1400) +#define _CRT_SECURE_NO_DEPRECATE 1 +#define _CRT_NONSTDC_NO_DEPRECATE 1 +#endif + /* ---------------------------------------------------------------- */ /* LDAP SUPPORT */ /* ---------------------------------------------------------------- */ @@ -370,10 +376,6 @@ /* ADDITIONAL DEFINITIONS */ /* ---------------------------------------------------------------- */ -/* Defines set for VS2005 to _not_ deprecate a few functions we use. */ -#define _CRT_SECURE_NO_DEPRECATE 1 -#define _CRT_NONSTDC_NO_DEPRECATE 1 - /* Define cpu-machine-OS */ #undef OS #if defined(_M_IX86) || defined(__i386__) /* x86 (MSVC or gcc) */ diff --git a/lib/config-win32ce.h b/lib/config-win32ce.h index 4d4016079..7531d4b1f 100644 --- a/lib/config-win32ce.h +++ b/lib/config-win32ce.h @@ -308,6 +308,12 @@ /* Undef keyword 'const' if it does not work. */ /* #undef const */ +/* Define to avoid VS2005 complaining about portable C functions */ +#if defined(_MSC_VER) && (_MSC_VER >= 1400) +#define _CRT_SECURE_NO_DEPRECATE 1 +#define _CRT_NONSTDC_NO_DEPRECATE 1 +#endif + /* ---------------------------------------------------------------- */ /* LDAP SUPPORT */ /* ---------------------------------------------------------------- */ @@ -320,10 +326,6 @@ /* ADDITIONAL DEFINITIONS */ /* ---------------------------------------------------------------- */ -/* Defines set for VS2005 to _not_ deprecate a few functions we use. */ -#define _CRT_SECURE_NO_DEPRECATE 1 -#define _CRT_NONSTDC_NO_DEPRECATE 1 - /* Define cpu-machine-OS */ #undef OS #define OS "i386-pc-win32ce" diff --git a/src/config-win32.h b/src/config-win32.h index f3fb6201c..940dbf064 100644 --- a/src/config-win32.h +++ b/src/config-win32.h @@ -181,14 +181,16 @@ #define HAVE_LONGLONG 1 #endif +/* Define to avoid VS2005 complaining about portable C functions */ +#if defined(_MSC_VER) && (_MSC_VER >= 1400) +#define _CRT_SECURE_NO_DEPRECATE 1 +#define _CRT_NONSTDC_NO_DEPRECATE 1 +#endif + /* ---------------------------------------------------------------- */ /* ADDITIONAL DEFINITIONS */ /* ---------------------------------------------------------------- */ -/* Defines set for VS2005 to _not_ deprecate a few functions we use. */ -#define _CRT_SECURE_NO_DEPRECATE 1 -#define _CRT_NONSTDC_NO_DEPRECATE 1 - /* Define cpu-machine-OS */ #ifndef OS #define OS "i386-pc-win32"