Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
e9f4ac13
Commit
e9f4ac13
authored
Aug 05, 2017
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Suppress unused-variable warnings when building with ICU 4.2.
Tidy-up for commit
eccead9e
.
parent
f4f41baf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
13 deletions
+20
-13
src/backend/commands/collationcmds.c
src/backend/commands/collationcmds.c
+20
-13
No files found.
src/backend/commands/collationcmds.c
View file @
e9f4ac13
...
...
@@ -678,14 +678,30 @@ pg_import_system_collations(PG_FUNCTION_ARGS)
*/
for
(
i
=
-
1
;
i
<
ucol_countAvailable
();
i
++
)
{
/*
* In ICU 4.2, ucol_getKeywordsForLocale() sometimes returns
* values that will not be accepted by uloc_toLanguageTag(). Skip
* loading keyword variants in that version. (Both
* ucol_getKeywordValuesForLocale() and uloc_toLanguageTag() are
* new in ICU 4.2, so older versions are not supported at all.)
*
* XXX We have no information about ICU 4.3 through 4.7, but we
* know the code below works with 4.8.
*/
#if U_ICU_VERSION_MAJOR_NUM > 4 || (U_ICU_VERSION_MAJOR_NUM == 4 && U_ICU_VERSION_MINOR_NUM > 2)
#define LOAD_ICU_KEYWORD_VARIANTS
#endif
const
char
*
name
;
char
*
langtag
;
char
*
icucomment
;
const
char
*
collcollate
;
Oid
collid
;
#ifdef LOAD_ICU_KEYWORD_VARIANTS
UEnumeration
*
en
;
UErrorCode
status
;
const
char
*
val
;
Oid
collid
;
#endif
if
(
i
==
-
1
)
name
=
""
;
/* ICU root locale */
...
...
@@ -721,18 +737,9 @@ pg_import_system_collations(PG_FUNCTION_ARGS)
}
/*
* Add keyword variants
*
* In ICU 4.2, ucol_getKeywordsForLocale() sometimes returns
* values that will not be accepted by uloc_toLanguageTag(). Skip
* loading keyword variants in that version. (Both
* ucol_getKeywordValuesForLocale() and uloc_toLanguageTag() are
* new in ICU 4.2, so older versions are not supported at all.)
*
* XXX We have no information about ICU 4.3 through 4.7, but we
* know the below works with 4.8.
* Add keyword variants, if enabled.
*/
#if
U_ICU_VERSION_MAJOR_NUM > 4 || (U_ICU_VERSION_MAJOR_NUM == 4 && U_ICU_VERSION_MINOR_NUM > 2)
#if
def LOAD_ICU_KEYWORD_VARIANTS
status
=
U_ZERO_ERROR
;
en
=
ucol_getKeywordValuesForLocale
(
"collation"
,
name
,
TRUE
,
&
status
);
if
(
U_FAILURE
(
status
))
...
...
@@ -779,7 +786,7 @@ pg_import_system_collations(PG_FUNCTION_ARGS)
(
errmsg
(
"could not get keyword values for locale
\"
%s
\"
: %s"
,
name
,
u_errorName
(
status
))));
uenum_close
(
en
);
#endif
/*
ICU >4.2
*/
#endif
/*
LOAD_ICU_KEYWORD_VARIANTS
*/
}
}
#endif
/* USE_ICU */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment