summaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
authorTom Lane2017-09-22 15:00:58 +0000
committerTom Lane2017-09-22 15:00:58 +0000
commit85feb77aa09cda9ff3e12cf95c757c499dc25343 (patch)
tree313b8bb0eb9cf4cff63a92dd5345d9d5c51b3b3a /src/backend/utils
parente6023ee7fa73a2d9a2d7524f63584844b2291def (diff)
Assume wcstombs(), towlower(), and sibling functions are always present.
These functions are required by SUS v2, which is our minimum baseline for Unix platforms, and are present on all interesting Windows versions as well. Even our oldest buildfarm members have them. Thus, we were not testing the "!USE_WIDE_UPPER_LOWER" code paths, which explains why the bug fixed in commit e6023ee7f escaped detection. Per discussion, there seems to be no more real-world value in maintaining this option. Hence, remove the configure-time tests for wcstombs() and towlower(), remove the USE_WIDE_UPPER_LOWER symbol, and remove all the !USE_WIDE_UPPER_LOWER code. There's not actually all that much of the latter, but simplifying the #if nests is a win in itself. Discussion: https://postgr.es/m/20170921052928.GA188913@rfd.leadboat.com
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/adt/formatting.c6
-rw-r--r--src/backend/utils/adt/pg_locale.c5
2 files changed, 1 insertions, 10 deletions
diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c
index 2bf484cda31..7877af2d6be 100644
--- a/src/backend/utils/adt/formatting.c
+++ b/src/backend/utils/adt/formatting.c
@@ -1565,7 +1565,6 @@ str_tolower(const char *buff, size_t nbytes, Oid collid)
else
#endif
{
-#ifdef USE_WIDE_UPPER_LOWER
if (pg_database_encoding_max_length() > 1)
{
wchar_t *workspace;
@@ -1604,7 +1603,6 @@ str_tolower(const char *buff, size_t nbytes, Oid collid)
pfree(workspace);
}
else
-#endif /* USE_WIDE_UPPER_LOWER */
{
char *p;
@@ -1689,7 +1687,6 @@ str_toupper(const char *buff, size_t nbytes, Oid collid)
else
#endif
{
-#ifdef USE_WIDE_UPPER_LOWER
if (pg_database_encoding_max_length() > 1)
{
wchar_t *workspace;
@@ -1728,7 +1725,6 @@ str_toupper(const char *buff, size_t nbytes, Oid collid)
pfree(workspace);
}
else
-#endif /* USE_WIDE_UPPER_LOWER */
{
char *p;
@@ -1814,7 +1810,6 @@ str_initcap(const char *buff, size_t nbytes, Oid collid)
else
#endif
{
-#ifdef USE_WIDE_UPPER_LOWER
if (pg_database_encoding_max_length() > 1)
{
wchar_t *workspace;
@@ -1865,7 +1860,6 @@ str_initcap(const char *buff, size_t nbytes, Oid collid)
pfree(workspace);
}
else
-#endif /* USE_WIDE_UPPER_LOWER */
{
char *p;
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c
index 3d3d8aa4b65..5ad75efb7a2 100644
--- a/src/backend/utils/adt/pg_locale.c
+++ b/src/backend/utils/adt/pg_locale.c
@@ -1587,6 +1587,7 @@ icu_from_uchar(char **result, const UChar *buff_uchar, int32_t len_uchar)
return len_result;
}
+
#endif /* USE_ICU */
/*
@@ -1594,8 +1595,6 @@ icu_from_uchar(char **result, const UChar *buff_uchar, int32_t len_uchar)
* Therefore we keep them here rather than with the mbutils code.
*/
-#ifdef USE_WIDE_UPPER_LOWER
-
/*
* wchar2char --- convert wide characters to multibyte format
*
@@ -1762,5 +1761,3 @@ char2wchar(wchar_t *to, size_t tolen, const char *from, size_t fromlen,
return result;
}
-
-#endif /* USE_WIDE_UPPER_LOWER */