mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
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
This commit is contained in:
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user