Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5c7121b

Browse files
committed
Fix function-defined-but-not-used warning.
Buildfarm member jacana (MinGW) has been complaining thatget_iso_localename is defined but not used. This is evidentlyfallout from the recent removal of VS2013 support in pg_locale.c.Rearrange the #ifs so that get_iso_localename and its subroutinesearch_locale_enum won't get built on MinGW.I also noticed that a comment in get_iso_localename cross-referenced a comment in IsoLocaleName that isn't there anymore.Put back what I think is the referenced material.
1 parent692df42 commit5c7121b

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

‎src/backend/utils/adt/pg_locale.c

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static HTAB *collation_cache = NULL;
118118

119119

120120
#if defined(WIN32)&& defined(LC_MESSAGES)
121-
staticchar*IsoLocaleName(constchar*);/* MSVC specific */
121+
staticchar*IsoLocaleName(constchar*);
122122
#endif
123123

124124
#ifdefUSE_ICU
@@ -950,6 +950,8 @@ cache_locale_time(void)
950950
* [2] https://docs.microsoft.com/en-us/windows/win32/intl/locale-names
951951
*/
952952

953+
#if defined(_MSC_VER)
954+
953955
/*
954956
* Callback function for EnumSystemLocalesEx() in get_iso_localename().
955957
*
@@ -1088,8 +1090,11 @@ get_iso_localename(const char *winlocname)
10881090
returnNULL;
10891091

10901092
/*
1091-
* Simply replace the hyphen with an underscore. See comments in
1092-
* IsoLocaleName.
1093+
* Since the message catalogs sit on a case-insensitive filesystem, we
1094+
* need not standardize letter case here. So long as we do not ship
1095+
* message catalogs for which it would matter, we also need not
1096+
* translate the script/variant portion, e.g. uz-Cyrl-UZ to
1097+
* uz_UZ@cyrillic. Simply replace the hyphen with an underscore.
10931098
*/
10941099
hyphen=strchr(iso_lc_messages,'-');
10951100
if (hyphen)
@@ -1103,7 +1108,6 @@ get_iso_localename(const char *winlocname)
11031108
staticchar*
11041109
IsoLocaleName(constchar*winlocname)
11051110
{
1106-
#if defined(_MSC_VER)
11071111
staticchariso_lc_messages[LOCALE_NAME_MAX_LENGTH];
11081112

11091113
if (pg_strcasecmp("c",winlocname)==0||
@@ -1114,10 +1118,18 @@ IsoLocaleName(const char *winlocname)
11141118
}
11151119
else
11161120
returnget_iso_localename(winlocname);
1121+
}
11171122

1118-
#endif/* defined(_MSC_VER) */
1119-
returnNULL;/* Not supported on this version of msvc/mingw */
1123+
#else/* !defined(_MSC_VER) */
1124+
1125+
staticchar*
1126+
IsoLocaleName(constchar*winlocname)
1127+
{
1128+
returnNULL;/* Not supported on MinGW */
11201129
}
1130+
1131+
#endif/* defined(_MSC_VER) */
1132+
11211133
#endif/* WIN32 && LC_MESSAGES */
11221134

11231135

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp