Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nqUgw-0001aZ-Mr for pgsql-hackers@arkaria.postgresql.org; Mon, 16 May 2022 06:58:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nqUgu-00069X-IX for pgsql-hackers@arkaria.postgresql.org; Mon, 16 May 2022 06:58:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nqUgs-000605-QB for pgsql-hackers@lists.postgresql.org; Mon, 16 May 2022 06:58:52 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nqUgn-0004wM-Rj for pgsql-hackers@lists.postgresql.org; Mon, 16 May 2022 06:58:49 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id D8B075C01C2 for ; Mon, 16 May 2022 02:58:44 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 16 May 2022 02:58:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to; s=fm1; t= 1652684324; x=1652770724; bh=uf0/3ABpiAJ7KdbJWH3Vl+BidyK/jgi3lA+ Z+D5BS4g=; b=OdMfUHlHK1xo/U0RcbW8g4363ZwVz4iKGijfD73Dn3mc8E4ybM8 UlzjpCzX3etmiZ4HzOsvV1G5dDl32q4ihtu36r6ScF3i2blqoqwoqCjSdSwzz2Gc sd9MKKjwN5naARFW3+17CtEYJdMLS2YV2E8svSK7ulSvDbWR5krUmTLLn813Nhmh qTja/3uypsZCQDdWhjGm+foHxVIwC5TCeUSRFHGqIDQbPfc8juGm5OceI99gCrDH sUQh5SrnbFxLFFh/AMnEGGSWrS763XPdamWdncakfY6AIXrKIEu5rAuqjxt+Qmm3 ekZmaYD1ChsIsDW83x15zfDLOqeuJydaPQw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1652684324; x=1652770724; bh=uf0/3ABpiAJ7K dbJWH3Vl+BidyK/jgi3lA+Z+D5BS4g=; b=seSfXsPHJ575gx7pLsc2I5stxjcSH WT2Lt/vy4uOLG9MiaxzW/fOydRoE3ta4y3Orpzj/dhUznMVi6GN76iECncM+aVZp pfaZVfiin75rxhXaJIhxwt3zg3e0AvE9GHIUCb7kkdtzBwtCCq6ArurpUes9dMZv y6xtgFFHwPYvqVIQkZ7eaefBRWPmDICImghw9w0LBPjuzzIC0/QyLKjocdsXWgrc JGF1CIdk914bMgHwCkVaoLaIincWp4NDQRNqdv9cjheLaFF/u2h8uH+sXnfT37DS OZQxtr3qPQ4/p60GJbwPiRZYTILLrQ++LmhSelMm2v0SqWEnrXXOw6JwA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrheeggdduudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkgggtugesghdtreertddtvden ucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquh hivghrrdighiiiqeenucggtffrrghtthgvrhhnpedvtdffteegtdfhuefgvedvtdejgfeu gfeggfejgfdvhefgfeevieektdelkefhgfenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 16 May 2022 02:58:43 -0400 (EDT) Date: Mon, 16 May 2022 15:58:40 +0900 From: Michael Paquier To: Postgres hackers Subject: Remove support for Visual Studio 2013 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ansJecIVaAL8Yx+B" Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --ansJecIVaAL8Yx+B Content-Type: multipart/mixed; boundary="Dmw8nPGypJadEYm0" Content-Disposition: inline --Dmw8nPGypJadEYm0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi all, Cutting support for now-unsupported versions of Windows is in the air for a couple of months, and while looking at the code a first cleanup that looked rather obvious to me is the removal of support for VS 2013, as of something to do for v16~. The website of Microsoft has only documentation for VS >= 2015 as far as I can see. Note also that VS can be downloaded down to 2012 on their official website, and that the buildfarm members only use VS >= 2017. The patch attached cleans up the following things proper to VS 2013: - Locale handling. - MIN_WINNT assignment. - Some strtof() business, as of win32_port.h. - Removal of _set_FMA3_enable() in main.c related to floating-point operations. - MSVC scripts, but that's less interesting considering the work done with meson. A nice result is that this completely removes all the checks related to the version number of _MSC_VER from the core code, making the code depend only on the definition if the flag. Thanks, -- Michael --Dmw8nPGypJadEYm0 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Remove-support-for-VS-2013.patch" Content-Transfer-Encoding: quoted-printable =46rom 7502f8c9a114ac483e553f444301a23e5c65cc2c Mon Sep 17 00:00:00 2001 =46rom: Michael Paquier Date: Mon, 16 May 2022 15:20:26 +0900 Subject: [PATCH] Remove support for VS 2013 --- src/include/port/win32.h | 10 ++++---- src/include/port/win32_port.h | 7 +----- src/backend/main/main.c | 22 ----------------- src/backend/utils/adt/float.c | 6 +---- src/backend/utils/adt/pg_locale.c | 40 ------------------------------- src/port/chklocale.c | 16 +------------ doc/src/sgml/install-windows.sgml | 10 ++++---- src/tools/msvc/MSBuildProject.pm | 27 +-------------------- src/tools/msvc/README | 8 +++---- src/tools/msvc/Solution.pm | 28 ---------------------- src/tools/msvc/VSObjectFactory.pm | 12 ++-------- 11 files changed, 19 insertions(+), 167 deletions(-) diff --git a/src/include/port/win32.h b/src/include/port/win32.h index c6213c77c3..539f3ec6d1 100644 --- a/src/include/port/win32.h +++ b/src/include/port/win32.h @@ -11,12 +11,12 @@ =20 /* * Make sure _WIN32_WINNT has the minimum required value. - * 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 minimum version is Windows XP (0x0501). + * Leave a higher value in place. When building with Visual Studio the + * minimum requirement is Windows Vista (0x0600) to get support for + * GetLocaleInfoEx() with locales. For everything else the minimum + * version is Windows XP (0x0501). */ -#if defined(_MSC_VER) && _MSC_VER >=3D 1900 +#ifdef _MSC_VER #define MIN_WINNT 0x0600 #else #define MIN_WINNT 0x0501 diff --git a/src/include/port/win32_port.h b/src/include/port/win32_port.h index dbbf88f8e8..c0225603f2 100644 --- a/src/include/port/win32_port.h +++ b/src/include/port/win32_port.h @@ -531,13 +531,8 @@ typedef unsigned short mode_t; =20 #endif /* _MSC_VER */ =20 -#if (defined(_MSC_VER) && (_MSC_VER < 1900)) || \ - defined(__MINGW32__) || defined(__MINGW64__) +#if defined(__MINGW32__) || defined(__MINGW64__) /* - * VS2013 has a strtof() that seems to give correct answers for valid inpu= t, - * even on the rounding edge cases, but which doesn't handle out-of-range - * input correctly. Work around that. - * * Mingw claims to have a strtof, and my reading of its source code sugges= ts * that it ought to work (and not need this hack), but the regression test * results disagree with me; whether this is a version issue or not is not diff --git a/src/backend/main/main.c b/src/backend/main/main.c index c43a527d3f..bb782fa1ec 100644 --- a/src/backend/main/main.c +++ b/src/backend/main/main.c @@ -30,11 +30,6 @@ #include #endif =20 -#if defined(_M_AMD64) && _MSC_VER =3D=3D 1800 -#include -#include -#endif - #include "bootstrap/bootstrap.h" #include "common/username.h" #include "port/atomics.h" @@ -290,23 +285,6 @@ startup_hacks(const char *progname) _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); - -#if defined(_M_AMD64) && _MSC_VER =3D=3D 1800 - - /*---------- - * Avoid crashing in certain floating-point operations if we were - * compiled for x64 with MS Visual Studio 2013 and are running on - * Windows prior to 7/2008R2 SP1 on an AVX2-capable CPU. - * - * Ref: https://connect.microsoft.com/VisualStudio/feedback/details/8110= 93/visual-studio-2013-rtm-c-x64-code-generation-bug-for-avx2-instructions - *---------- - */ - if (!IsWindows7SP1OrGreater()) - { - _set_FMA3_enable(0); - } -#endif /* defined(_M_AMD64) && _MSC_VER =3D=3D 1800 */ - } #endif /* WIN32 */ =20 diff --git a/src/backend/utils/adt/float.c b/src/backend/utils/adt/float.c index 63bb0f2277..fc8f39a7a9 100644 --- a/src/backend/utils/adt/float.c +++ b/src/backend/utils/adt/float.c @@ -249,13 +249,9 @@ float4in(PG_FUNCTION_ARGS) * precision). We'd prefer not to throw error for that, so try to * detect whether it's a "real" out-of-range condition by checking * to see if the result is zero or huge. - * - * Use isinf() rather than HUGE_VALF on VS2013 because it - * generates a spurious overflow warning for -HUGE_VALF. Also use - * isinf() if HUGE_VALF is missing. */ if (val =3D=3D 0.0 || -#if !defined(HUGE_VALF) || (defined(_MSC_VER) && (_MSC_VER < 1900)) +#if !defined(HUGE_VALF) isinf(val) #else (val >=3D HUGE_VALF || val <=3D -HUGE_VALF) diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_l= ocale.c index a0490a7522..34bd8d424e 100644 --- a/src/backend/utils/adt/pg_locale.c +++ b/src/backend/utils/adt/pg_locale.c @@ -960,7 +960,6 @@ cache_locale_time(void) * [2] https://docs.microsoft.com/en-us/windows/win32/intl/locale-names */ =20 -#if _MSC_VER >=3D 1900 /* * Callback function for EnumSystemLocalesEx() in get_iso_localename(). * @@ -1110,7 +1109,6 @@ get_iso_localename(const char *winlocname) =20 return NULL; } -#endif /* _MSC_VER >=3D 1900 */ =20 static char * IsoLocaleName(const char *winlocname) @@ -1125,46 +1123,8 @@ IsoLocaleName(const char *winlocname) return iso_lc_messages; } else - { -#if (_MSC_VER >=3D 1900) /* Visual Studio 2015 or later */ return get_iso_localename(winlocname); -#else - _locale_t loct; =20 - loct =3D _create_locale(LC_CTYPE, winlocname); - if (loct !=3D NULL) - { - size_t rc; - char *hyphen; - - /* Locale names use only ASCII, any conversion locale suffices. */ - rc =3D wchar2char(iso_lc_messages, loct->locinfo->locale_name[LC_CTYPE], - sizeof(iso_lc_messages), NULL); - _free_locale(loct); - if (rc =3D=3D -1 || rc =3D=3D sizeof(iso_lc_messages)) - return NULL; - - /* - * Since the message catalogs sit on a case-insensitive - * filesystem, we need not standardize letter case here. So long - * as we do not ship message catalogs for which it would matter, - * we also need not translate the script/variant portion, e.g. - * uz-Cyrl-UZ to uz_UZ@cyrillic. Simply replace the hyphen with - * an underscore. - * - * Note that the locale name can be less-specific than the value - * we would derive under earlier Visual Studio releases. For - * example, French_France.1252 yields just "fr". This does not - * affect any of the country-specific message catalogs available - * as of this writing (pt_BR, zh_CN, zh_TW). - */ - hyphen =3D strchr(iso_lc_messages, '-'); - if (hyphen) - *hyphen =3D '_'; - return iso_lc_messages; - } -#endif /* Visual Studio 2015 or later */ - } #endif /* defined(_MSC_VER) */ return NULL; /* Not supported on this version of msvc/mingw */ } diff --git a/src/port/chklocale.c b/src/port/chklocale.c index c85d8da3c8..fdb137640c 100644 --- a/src/port/chklocale.c +++ b/src/port/chklocale.c @@ -211,22 +211,9 @@ static char * win32_langinfo(const char *ctype) { char *r =3D NULL; - -#if defined(_MSC_VER) && (_MSC_VER < 1900) - _locale_t loct =3D NULL; - - loct =3D _create_locale(LC_CTYPE, ctype); - if (loct !=3D NULL) - { - r =3D malloc(16); /* excess */ - if (r !=3D NULL) - sprintf(r, "CP%u", loct->locinfo->lc_codepage); - _free_locale(loct); - } -#else char *codepage; =20 -#if defined(_MSC_VER) && (_MSC_VER >=3D 1900) +#if defined(_MSC_VER) uint32 cp; WCHAR wctype[LOCALE_NAME_MAX_LENGTH]; =20 @@ -279,7 +266,6 @@ win32_langinfo(const char *ctype) } } } -#endif =20 return r; } diff --git a/doc/src/sgml/install-windows.sgml b/doc/src/sgml/install-windo= ws.sgml index bcfd5a1a10..ef30e797e3 100644 --- a/doc/src/sgml/install-windows.sgml +++ b/doc/src/sgml/install-windows.sgml @@ -22,7 +22,7 @@ Windows. The simplest way to build with Microsoft tools is to install Visual Studio 2022 and use the included compiler. It is also possible to build with the full - Microsoft Visual C++ 2013 to 2022. + Microsoft Visual C++ 2015 to 2022. In some cases that requires the installation of the Windows SDK in addition to the compiler. @@ -77,19 +77,17 @@ Both 32-bit and 64-bit builds are possible with the Microsoft Compiler s= uite. 32-bit PostgreSQL builds are possible with - Visual Studio 2013 to + Visual Studio 2015 to Visual Studio 2022, as well as standalone Windows SDK releases 8.1a to 10. 64-bit PostgreSQL builds are supported with Microsoft Windows SDK version 8.1a to 10 or - Visual Studio 2013 and above. Compilation + Visual Studio 2015 and above. Compilation is supported down to Windows 7 and Windows Server 2008 R2 SP1 when building with - Visual Studio 2013 to + Visual Studio 2015 to Visual Studio 2022.