diff options
author | Andrew Dunstan | 2016-04-29 11:59:47 +0000 |
---|---|---|
committer | Andrew Dunstan | 2016-04-29 12:09:07 +0000 |
commit | 0fb54de9aa4ffb792ea63af853146021ae501f12 (patch) | |
tree | 143d27120773629c601894184c065b1eef12ba9b /src/include/port/win32.h | |
parent | 59455018a8120bb3c02680b0f9764492c5283d99 (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/port/win32.h')
-rw-r--r-- | src/include/port/win32.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/include/port/win32.h b/src/include/port/win32.h index bd2ad99c113..ddf818748b7 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. |