summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorAndrew Dunstan2016-04-29 11:59:47 +0000
committerAndrew Dunstan2018-09-11 19:44:42 +0000
commit9ca32a6ebc12d91a4df314e47bb1faf933e5bbb4 (patch)
tree09b0a16744688abe52257336e5c773ca348c783a /src/include
parent35ea98f79af299fd946d160eabf0a79e033d8115 (diff)
Support building with Visual Studio 2015
Adjust the way we detect the locale. As a result the minumum Windows version supported by VS2015 and later is Windows Vista. Add some tweaks to remove new compiler warnings. Remove documentation references to the now obsolete msysGit. Michael Paquier, somewhat edited by me, reviewed by Christian Ullrich. Rather belated backpatch to 9.4 and 9.3
Diffstat (limited to 'src/include')
-rw-r--r--src/include/port/win32.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index a4891d602b6..f43a87f22fc 100644
--- a/src/include/port/win32.h
+++ b/src/include/port/win32.h
@@ -6,14 +6,28 @@
/*
* Make sure _WIN32_WINNT has the minimum required value.
- * Leave a higher value in place.
-*/
-#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0501
+ * Leave a higher value in place. When building with at least Visual
+ * Studio 2015 the minimum requirement is Windows Vista (0x0600) to
+ * get support for GetLocaleInfoEx() with locales. For everything else
+ * the minumum version is Windows XP (0x0501).
+ * Also for VS2015, add a define that stops compiler complaints about
+ * using the old Winsock API.
+ */
+#if defined(_MSC_VER) && _MSC_VER >= 1900
+#define _WINSOCK_DEPRECATED_NO_WARNINGS
+#define MIN_WINNT 0x0600
+#else
+#define MIN_WINNT 0x0501
+#endif
+
+#if defined(_WIN32_WINNT) && _WIN32_WINNT < MIN_WINNT
#undef _WIN32_WINNT
#endif
+
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0501
+#define _WIN32_WINNT MIN_WINNT
#endif
+
/*
* Always build with SSPI support. Keep it as a #define in case
* we want a switch to disable it sometime in the future.