diff options
| author | Peter Eisentraut <peter@eisentraut.org> | 2019-10-08 10:27:30 +0200 |
|---|---|---|
| committer | Peter Eisentraut <peter@eisentraut.org> | 2019-10-08 10:50:54 +0200 |
| commit | 38d8dce61fff09daae0edb6bcdd42b0c7f10ebcd (patch) | |
| tree | b590d669ebe12f434b403643b0fcaa12b92cd91e /src/backend | |
| parent | a7471bd85c05f849e88d6cfe9da3c795008e8f2e (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')
| -rw-r--r-- | src/backend/utils/adt/pg_locale.c | 23 | ||||
| -rw-r--r-- | src/backend/utils/adt/selfuncs.c | 13 |
2 files changed, 2 insertions, 34 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 */ diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 17101298fb0..35a8995f623 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -4092,20 +4092,7 @@ convert_string_datum(Datum value, Oid typid, Oid collid, bool *failure) * crashes since it will only give an estimation error and nothing * fatal. */ -#if _MSC_VER == 1400 /* VS.Net 2005 */ - - /* - * - * http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=99694 - */ - { - char x[1]; - - xfrmlen = strxfrm(x, val, 0); - } -#else xfrmlen = strxfrm(NULL, val, 0); -#endif #ifdef WIN32 /* |
