summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/pg_locale.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2019-10-08 10:27:30 +0200
committerPeter Eisentraut <peter@eisentraut.org>2019-10-08 10:50:54 +0200
commit38d8dce61fff09daae0edb6bcdd42b0c7f10ebcd (patch)
treeb590d669ebe12f434b403643b0fcaa12b92cd91e /src/backend/utils/adt/pg_locale.c
parenta7471bd85c05f849e88d6cfe9da3c795008e8f2e (diff)
Remove some code for old unsupported versions of MSVC
As of d9dd406fe281d22d5238d3c26a7182543c711e74, we require MSVC 2013, which means _MSC_VER >= 1800. This means that conditionals about older versions of _MSC_VER can be removed or simplified. Previous code was also in some cases handling MinGW, where _MSC_VER is not defined at all, incorrectly, such as in pg_ctl.c and win32_port.h, leading to some compiler warnings. This should now be handled better. Reviewed-by: Michael Paquier <michael@paquier.xyz>
Diffstat (limited to 'src/backend/utils/adt/pg_locale.c')
-rw-r--r--src/backend/utils/adt/pg_locale.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c
index b2f08ead454..2a076a3dfd1 100644
--- a/src/backend/utils/adt/pg_locale.c
+++ b/src/backend/utils/adt/pg_locale.c
@@ -973,7 +973,7 @@ cache_locale_time(void)
static char *
IsoLocaleName(const char *winlocname)
{
-#if (_MSC_VER >= 1400) /* VC8.0 or later */
+#ifdef _MSC_VER
static char iso_lc_messages[32];
_locale_t loct = NULL;
@@ -987,7 +987,6 @@ IsoLocaleName(const char *winlocname)
loct = _create_locale(LC_CTYPE, winlocname);
if (loct != NULL)
{
-#if (_MSC_VER >= 1700) /* Visual Studio 2012 or later */
size_t rc;
char *hyphen;
@@ -1014,28 +1013,10 @@ IsoLocaleName(const char *winlocname)
hyphen = strchr(iso_lc_messages, '-');
if (hyphen)
*hyphen = '_';
-#else
- char isolang[32],
- isocrty[32];
- LCID lcid;
-
- lcid = loct->locinfo->lc_handle[LC_CTYPE];
- if (lcid == 0)
- lcid = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT);
- _free_locale(loct);
-
- if (!GetLocaleInfoA(lcid, LOCALE_SISO639LANGNAME, isolang, sizeof(isolang)))
- return NULL;
- if (!GetLocaleInfoA(lcid, LOCALE_SISO3166CTRYNAME, isocrty, sizeof(isocrty)))
- return NULL;
- snprintf(iso_lc_messages, sizeof(iso_lc_messages) - 1, "%s_%s", isolang, isocrty);
-#endif
return iso_lc_messages;
}
- return NULL;
-#else
+#endif /* _MSC_VER */
return NULL; /* Not supported on this version of msvc/mingw */
-#endif /* _MSC_VER >= 1400 */
}
#endif /* WIN32 && LC_MESSAGES */