aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2017-06-12 10:28:37 -0400
committerPeter Eisentraut <peter_e@gmx.net>2017-06-12 10:28:37 -0400
commit253504fb9f804b6aa7cec9b9b2506fa88accf0dc (patch)
tree7a44348c67ac42fa2a514e71c93b5cc969b2363a
parentbf6e4c3c82d349dc311ef795cc8eb7a9badf49eb (diff)
downloadpostgresql-253504fb9f804b6aa7cec9b9b2506fa88accf0dc.tar.gz
postgresql-253504fb9f804b6aa7cec9b9b2506fa88accf0dc.zip
Fix build of ICU support in Windows
and also any platform that does not have locale_t but enabled ICU. Author: Ashutosh Sharma <ashu.coek88@gmail.com>
-rw-r--r--src/backend/commands/collationcmds.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/commands/collationcmds.c b/src/backend/commands/collationcmds.c
index 110fb7ef653..ab702c2479c 100644
--- a/src/backend/commands/collationcmds.c
+++ b/src/backend/commands/collationcmds.c
@@ -411,10 +411,10 @@ get_icu_locale_comment(const char *localename)
Datum
pg_import_system_collations(PG_FUNCTION_ARGS)
{
-#if defined(HAVE_LOCALE_T) && !defined(WIN32)
bool if_not_exists = PG_GETARG_BOOL(0);
Oid nspid = PG_GETARG_OID(1);
+#if defined(HAVE_LOCALE_T) && !defined(WIN32)
FILE *locale_a_handle;
char localebuf[NAMEDATALEN]; /* we assume ASCII so this is fine */
int count = 0;
@@ -431,6 +431,12 @@ pg_import_system_collations(PG_FUNCTION_ARGS)
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
(errmsg("must be superuser to import system collations"))));
+#if !(defined(HAVE_LOCALE_T) && !defined(WIN32)) && !defined(USE_ICU)
+ /* silence compiler warnings */
+ (void) if_not_exists;
+ (void) nspid;
+#endif
+
#if defined(HAVE_LOCALE_T) && !defined(WIN32)
locale_a_handle = OpenPipeStream("locale -a", "r");
if (locale_a_handle == NULL)