summaryrefslogtreecommitdiff
path: root/config-win32.h
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-12-18 18:08:19 +0000
committerYang Tse <yangsita@gmail.com>2007-12-18 18:08:19 +0000
commite04eb55f8e752b667768e216c325faeb387b881d (patch)
tree28199ad0f21eee64d1c627f8b11ade187359e45b /config-win32.h
parentad10862b8d5c166a12b20e689947bd0061c85e4b (diff)
downloadc-ares-e04eb55f8e752b667768e216c325faeb387b881d.tar.gz
c-ares-e04eb55f8e752b667768e216c325faeb387b881d.tar.bz2
c-ares-e04eb55f8e752b667768e216c325faeb387b881d.zip
MSVC 9.0 (VS2008) does not support Windows build targets prior to WinXP,
and makes wrong asumptions of build target when it isn't specified. So, if no build target has been defined we will target WinXP when building with MSVC 9.0 (VS2008).
Diffstat (limited to 'config-win32.h')
-rw-r--r--config-win32.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/config-win32.h b/config-win32.h
index 257a984..854143d 100644
--- a/config-win32.h
+++ b/config-win32.h
@@ -169,6 +169,20 @@
#define _CRT_NONSTDC_NO_DEPRECATE 1
#endif
+/* VS2008 does not support Windows build targets prior to WinXP, */
+/* so, if no build target has been defined we will target WinXP. */
+#if defined(_MSC_VER) && (_MSC_VER >= 1500)
+# ifndef _WIN32_WINNT
+# define _WIN32_WINNT 0x0501
+# endif
+# ifndef WINVER
+# define WINVER 0x0501
+# endif
+# if (_WIN32_WINNT < 0x0501) || (WINVER < 0x0501)
+# error VS2008 does not support Windows build targets prior to WinXP
+# endif
+#endif
+
/* ---------------------------------------------------------------- */
/* IPV6 COMPATIBILITY */
/* ---------------------------------------------------------------- */