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

Commite9f4ac1

Browse files
committed
Suppress unused-variable warnings when building with ICU 4.2.
Tidy-up for commiteccead9.
1 parentf4f41ba commite9f4ac1

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

‎src/backend/commands/collationcmds.c

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -678,14 +678,30 @@ pg_import_system_collations(PG_FUNCTION_ARGS)
678678
*/
679679
for (i=-1;i<ucol_countAvailable();i++)
680680
{
681+
/*
682+
* In ICU 4.2, ucol_getKeywordsForLocale() sometimes returns
683+
* values that will not be accepted by uloc_toLanguageTag(). Skip
684+
* loading keyword variants in that version. (Both
685+
* ucol_getKeywordValuesForLocale() and uloc_toLanguageTag() are
686+
* new in ICU 4.2, so older versions are not supported at all.)
687+
*
688+
* XXX We have no information about ICU 4.3 through 4.7, but we
689+
* know the code below works with 4.8.
690+
*/
691+
#ifU_ICU_VERSION_MAJOR_NUM>4|| (U_ICU_VERSION_MAJOR_NUM==4&&U_ICU_VERSION_MINOR_NUM>2)
692+
#defineLOAD_ICU_KEYWORD_VARIANTS
693+
#endif
694+
681695
constchar*name;
682696
char*langtag;
683697
char*icucomment;
684698
constchar*collcollate;
699+
Oidcollid;
700+
#ifdefLOAD_ICU_KEYWORD_VARIANTS
685701
UEnumeration*en;
686702
UErrorCodestatus;
687703
constchar*val;
688-
Oidcollid;
704+
#endif
689705

690706
if (i==-1)
691707
name="";/* ICU root locale */
@@ -721,18 +737,9 @@ pg_import_system_collations(PG_FUNCTION_ARGS)
721737
}
722738

723739
/*
724-
* Add keyword variants
725-
*
726-
* In ICU 4.2, ucol_getKeywordsForLocale() sometimes returns
727-
* values that will not be accepted by uloc_toLanguageTag(). Skip
728-
* loading keyword variants in that version. (Both
729-
* ucol_getKeywordValuesForLocale() and uloc_toLanguageTag() are
730-
* new in ICU 4.2, so older versions are not supported at all.)
731-
*
732-
* XXX We have no information about ICU 4.3 through 4.7, but we
733-
* know the below works with 4.8.
740+
* Add keyword variants, if enabled.
734741
*/
735-
#ifU_ICU_VERSION_MAJOR_NUM>4|| (U_ICU_VERSION_MAJOR_NUM==4&&U_ICU_VERSION_MINOR_NUM>2)
742+
#ifdefLOAD_ICU_KEYWORD_VARIANTS
736743
status=U_ZERO_ERROR;
737744
en=ucol_getKeywordValuesForLocale("collation",name, TRUE,&status);
738745
if (U_FAILURE(status))
@@ -779,7 +786,7 @@ pg_import_system_collations(PG_FUNCTION_ARGS)
779786
(errmsg("could not get keyword values for locale \"%s\": %s",
780787
name,u_errorName(status))));
781788
uenum_close(en);
782-
#endif/*ICU >4.2 */
789+
#endif/*LOAD_ICU_KEYWORD_VARIANTS */
783790
}
784791
}
785792
#endif/* USE_ICU */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp