summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2016-04-29 07:59:47 -0400
committerAndrew Dunstan <andrew@dunslane.net>2016-04-29 08:06:25 -0400
commitda52474f3d3cbdf38d8a6677a4ebedaf402ade3a (patch)
tree5a9e9cf03b1d963e885a0f8c99f006055a2e1e93 /src/include
parent2e1b4adf39178416740efba975757e413a9fb3f9 (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. Backpatch to 9.5
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 cadba2b56ff..f9a9be1d1a1 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.