mirror of
https://github.com/postgres/postgres.git
synced 2025-04-29 13:56:47 +03:00
Fix build with !USE_WIDE_UPPER_LOWER
The placement of the ifdef blocks in formatting.c was pretty bogus, so the code failed to compile if USE_WIDE_UPPER_LOWER was not defined. Reported-by: Peter Geoghegan <pg@bowt.ie> Reported-by: Noah Misch <noah@leadboat.com>
This commit is contained in:
parent
e9c9ba7845
commit
c08c98df3d
@ -1528,7 +1528,6 @@ str_tolower(const char *buff, size_t nbytes, Oid collid)
|
|||||||
{
|
{
|
||||||
result = asc_tolower(buff, nbytes);
|
result = asc_tolower(buff, nbytes);
|
||||||
}
|
}
|
||||||
#ifdef USE_WIDE_UPPER_LOWER
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pg_locale_t mylocale = 0;
|
pg_locale_t mylocale = 0;
|
||||||
@ -1566,6 +1565,7 @@ str_tolower(const char *buff, size_t nbytes, Oid collid)
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
#ifdef USE_WIDE_UPPER_LOWER
|
||||||
if (pg_database_encoding_max_length() > 1)
|
if (pg_database_encoding_max_length() > 1)
|
||||||
{
|
{
|
||||||
wchar_t *workspace;
|
wchar_t *workspace;
|
||||||
@ -1603,8 +1603,8 @@ str_tolower(const char *buff, size_t nbytes, Oid collid)
|
|||||||
wchar2char(result, workspace, result_size, mylocale);
|
wchar2char(result, workspace, result_size, mylocale);
|
||||||
pfree(workspace);
|
pfree(workspace);
|
||||||
}
|
}
|
||||||
#endif /* USE_WIDE_UPPER_LOWER */
|
|
||||||
else
|
else
|
||||||
|
#endif /* USE_WIDE_UPPER_LOWER */
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
@ -1652,7 +1652,6 @@ str_toupper(const char *buff, size_t nbytes, Oid collid)
|
|||||||
{
|
{
|
||||||
result = asc_toupper(buff, nbytes);
|
result = asc_toupper(buff, nbytes);
|
||||||
}
|
}
|
||||||
#ifdef USE_WIDE_UPPER_LOWER
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pg_locale_t mylocale = 0;
|
pg_locale_t mylocale = 0;
|
||||||
@ -1690,6 +1689,7 @@ str_toupper(const char *buff, size_t nbytes, Oid collid)
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
#ifdef USE_WIDE_UPPER_LOWER
|
||||||
if (pg_database_encoding_max_length() > 1)
|
if (pg_database_encoding_max_length() > 1)
|
||||||
{
|
{
|
||||||
wchar_t *workspace;
|
wchar_t *workspace;
|
||||||
@ -1727,8 +1727,8 @@ str_toupper(const char *buff, size_t nbytes, Oid collid)
|
|||||||
wchar2char(result, workspace, result_size, mylocale);
|
wchar2char(result, workspace, result_size, mylocale);
|
||||||
pfree(workspace);
|
pfree(workspace);
|
||||||
}
|
}
|
||||||
#endif /* USE_WIDE_UPPER_LOWER */
|
|
||||||
else
|
else
|
||||||
|
#endif /* USE_WIDE_UPPER_LOWER */
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
@ -1777,7 +1777,6 @@ str_initcap(const char *buff, size_t nbytes, Oid collid)
|
|||||||
{
|
{
|
||||||
result = asc_initcap(buff, nbytes);
|
result = asc_initcap(buff, nbytes);
|
||||||
}
|
}
|
||||||
#ifdef USE_WIDE_UPPER_LOWER
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pg_locale_t mylocale = 0;
|
pg_locale_t mylocale = 0;
|
||||||
@ -1815,6 +1814,7 @@ str_initcap(const char *buff, size_t nbytes, Oid collid)
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
#ifdef USE_WIDE_UPPER_LOWER
|
||||||
if (pg_database_encoding_max_length() > 1)
|
if (pg_database_encoding_max_length() > 1)
|
||||||
{
|
{
|
||||||
wchar_t *workspace;
|
wchar_t *workspace;
|
||||||
@ -1864,8 +1864,8 @@ str_initcap(const char *buff, size_t nbytes, Oid collid)
|
|||||||
wchar2char(result, workspace, result_size, mylocale);
|
wchar2char(result, workspace, result_size, mylocale);
|
||||||
pfree(workspace);
|
pfree(workspace);
|
||||||
}
|
}
|
||||||
#endif /* USE_WIDE_UPPER_LOWER */
|
|
||||||
else
|
else
|
||||||
|
#endif /* USE_WIDE_UPPER_LOWER */
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user